mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-29 21:08:24 +00:00
Fix mg_http_common_url_parse
The only client of `mg_http_common_url_parse` (namely, `mg_connect_http_base`) expects `port_i` to be the index in the address string at which the port was added. PUBLISHED_FROM=b095926b5485e4674e3c59ff8481171831fb61ae
This commit is contained in:
1 parent
3a8464e4b8
commit
1ff61837ac
1 file changed
+2
-2
+2
-2
@@ -7421,8 +7421,8 @@ MG_INTERNAL int mg_http_common_url_parse(const char *url, const char *schema,
|
|||||||
|
|
||||||
if (addr_len == 0) goto cleanup;
|
if (addr_len == 0) goto cleanup;
|
||||||
if (port_pos < 0) {
|
if (port_pos < 0) {
|
||||||
*port_i = *use_ssl ? 443 : 80;
|
*port_i = addr_len;
|
||||||
addr_len += sprintf(*addr + addr_len, ":%d", *port_i);
|
addr_len += sprintf(*addr + addr_len, ":%d", *use_ssl ? 443 : 80);
|
||||||
} else {
|
} else {
|
||||||
*port_i = -1;
|
*port_i = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user