projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Increase URL length to 4k, only IE limits the length of the URL to 2083
[m6w6/ext-http]
/
http_url_api.c
diff --git
a/http_url_api.c
b/http_url_api.c
index 882c390549f284cfda18d883fb95310058978faa..4f20de5e847c1117d0cec3d4c830606b15f8cdb7 100644
(file)
--- a/
http_url_api.c
+++ b/
http_url_api.c
@@
-71,7
+71,7
@@
PHP_HTTP_API char *_http_absolute_url_ex(
} else if (purl->scheme) {
furl.scheme = purl->scheme;
#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
} else if (purl->scheme) {
furl.scheme = purl->scheme;
#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
- } else if (port && (se = getservbyport(htons(port), "tcp"))) {
+ } else if (port && (se = getservbyport(htons(
(short)
port), "tcp"))) {
furl.scheme = (scheme = estrdup(se->s_name));
#endif
} else {
furl.scheme = (scheme = estrdup(se->s_name));
#endif
} else {
@@
-136,12
+136,13
@@
PHP_HTTP_API char *_http_absolute_url_ex(
HTTP_URI_STRLCATL(URL, full_len, furl.host);
HTTP_URI_STRLCATL(URL, full_len, furl.host);
- if (( (!strcmp(furl.scheme, "http") && (furl.port != 80)) ||
+ if (furl.port && (
+ (!strcmp(furl.scheme, "http") && (furl.port != 80)) ||
(!strcmp(furl.scheme, "https") && (furl.port != 443))
#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
(!strcmp(furl.scheme, "https") && (furl.port != 443))
#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
-
||
((!(se = getservbyname(furl.scheme, "tcp"))) || (ntohs(se->s_port) != furl.port))
+
||
((!(se = getservbyname(furl.scheme, "tcp"))) || (ntohs(se->s_port) != furl.port))
#endif
#endif
-
) && furl.port
) {
+
)
) {
char port_string[8] = {0};
snprintf(port_string, 7, ":%u", furl.port);
HTTP_URI_STRLCATL(URL, full_len, port_string);
char port_string[8] = {0};
snprintf(port_string, 7, ":%u", furl.port);
HTTP_URI_STRLCATL(URL, full_len, port_string);