1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 09:04:14 +00:00

Merge remote-tracking branch 'purple/openssl'

This commit is contained in:
Jeff Becker 2016-06-30 08:57:59 -04:00
commit 1362177352
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B

View File

@ -85,7 +85,8 @@ namespace http {
} }
/* user[:pass] */ /* user[:pass] */
pos_c = url.find('@', pos_p); pos_c = url.find('@', pos_p);
if (pos_c != std::string::npos) { std::size_t pos_slash = url.find('/', pos_p);
if (pos_c != std::string::npos && (pos_slash == std::string::npos || pos_slash > pos_c)) {
std::size_t delim = url.find(':', pos_p); std::size_t delim = url.find(':', pos_p);
if (delim != std::string::npos && delim < pos_c) { if (delim != std::string::npos && delim < pos_c) {
user = url.substr(pos_p, delim - pos_p); user = url.substr(pos_p, delim - pos_p);
@ -94,7 +95,7 @@ namespace http {
} else { } else {
user = url.substr(pos_p, pos_c - pos_p); user = url.substr(pos_p, pos_c - pos_p);
} }
pos_p = pos_c + 1; pos_p = pos_c + 1;
} }
/* hostname[:port][/path] */ /* hostname[:port][/path] */
pos_c = url.find_first_of(":/", pos_p); pos_c = url.find_first_of(":/", pos_p);