diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-09-15 11:04:15 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-09-15 11:04:15 +0000 |
commit | 08741a59387f1e4c628d385cfd87a9a616dde310 (patch) | |
tree | 6c13bdd48244b3d1e92132cdc453376a599b35fc /src/htsnet.h | |
parent | b32b41cf08e1555c92897c9ac2f1e8f509b0cab3 (diff) |
Remove scope id (% character) in dotted address resolution (especially for catchurl proxy)
Diffstat (limited to 'src/htsnet.h')
-rw-r--r-- | src/htsnet.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/htsnet.h b/src/htsnet.h index e9c0629..6efe2ba 100644 --- a/src/htsnet.h +++ b/src/htsnet.h @@ -232,9 +232,15 @@ if (hpsize == sizeof(struct sockaddr_in6)) { \ /* Get dotted address */ #define SOCaddr_inetntoa(namebuf, namebuflen, ss, sslen) do { \ -(namebuf)[0]='\0'; \ -getnameinfo((struct sockaddr *)&(ss), sslen, \ - (namebuf), namebuflen, NULL, 0, NI_NUMERICHOST); \ + char *pos_; \ + (namebuf)[0]='\0'; \ + getnameinfo((struct sockaddr *)&(ss), sslen, \ + (namebuf), namebuflen, NULL, 0, NI_NUMERICHOST); \ + /* remove scope id */ \ + pos_ = strrchr(namebuf, '%'); \ + if (pos_ != NULL) { \ + *pos_ = '\0'; \ + } \ } while(0) /* Get protocol ID */ |