mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08: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:
parent
3a8464e4b8
commit
1ff61837ac
@ -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 (port_pos < 0) {
|
||||
*port_i = *use_ssl ? 443 : 80;
|
||||
addr_len += sprintf(*addr + addr_len, ":%d", *port_i);
|
||||
*port_i = addr_len;
|
||||
addr_len += sprintf(*addr + addr_len, ":%d", *use_ssl ? 443 : 80);
|
||||
} else {
|
||||
*port_i = -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user