|
|
@ -276,21 +276,24 @@ namespace client |
|
|
|
size_t offset = 0; |
|
|
|
size_t offset = 0; |
|
|
|
while (offset < len) |
|
|
|
while (offset < len) |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto semicolon = (const uint8_t *)memchr (buf + offset, ';', len - offset); |
|
|
|
std::string param = ExtractString (buf + offset, len - offset); |
|
|
|
if (semicolon) |
|
|
|
offset += param.length (); |
|
|
|
|
|
|
|
if (buf[offset] != '=') |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto l = semicolon - buf - offset + 1; |
|
|
|
LogPrint (eLogWarning, "I2CP: Unexpected character ", buf[offset], " instead '=' after ", param); |
|
|
|
auto equal = (const uint8_t *)memchr (buf + offset, '=', l); |
|
|
|
break; |
|
|
|
if (equal) |
|
|
|
} |
|
|
|
{ |
|
|
|
offset++; |
|
|
|
auto l1 = equal - buf - offset + 1; |
|
|
|
|
|
|
|
mapping.insert (std::make_pair (std::string ((const char *)(buf + offset), l1 -1), |
|
|
|
std::string value = ExtractString (buf + offset, len - offset); |
|
|
|
std::string ((const char *)(buf + offset + l1), l - l1 - 2))); |
|
|
|
offset += value.length (); |
|
|
|
} |
|
|
|
if (buf[offset] != ';') |
|
|
|
offset += l; |
|
|
|
{ |
|
|
|
} |
|
|
|
LogPrint (eLogWarning, "I2CP: Unexpected character ", buf[offset], " instead ';' after ", value); |
|
|
|
else |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
offset++; |
|
|
|
|
|
|
|
mapping.insert (std::make_pair (param, value)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|