Differences From Artifact [1aec658c7f]:
- File
utils/ofhttp/OFHTTP.m
— part of check-in
[7f102e8c95]
at
2020-10-31 19:16:46
on branch trunk
— OFHTTPClient: Remove didFailWithException
Instead, add an exception to didPerformRequest, to make it more
consistent with other places. (user: js, size: 29488) [annotate] [blame] [check-ins using]
To Artifact [c172d83732]:
- File utils/ofhttp/OFHTTP.m — part of check-in [4bbac7ab17] at 2020-11-01 11:35:03 on branch trunk — OFString: Add -[substring{From,To}Index:] (user: js, size: 29367) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
321 322 323 324 325 326 327 |
if (pos == OF_NOT_FOUND) {
[of_stderr writeLine: OF_LOCALIZED(@"invalid_input_header",
@"%[prog]: Headers must to be in format name:value!",
@"prog", [OFApplication programName])];
[OFApplication terminateWithStatus: 1];
}
| | | | < | | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
if (pos == OF_NOT_FOUND) {
[of_stderr writeLine: OF_LOCALIZED(@"invalid_input_header",
@"%[prog]: Headers must to be in format name:value!",
@"prog", [OFApplication programName])];
[OFApplication terminateWithStatus: 1];
}
name = [header substringToIndex: pos]
.stringByDeletingEnclosingWhitespaces;
value = [header substringFromIndex: pos + 1]
.stringByDeletingEnclosingWhitespaces;
[_clientHeaders setObject: value
forKey: name];
}
- (void)setBody: (OFString *)path
{
|
| ︙ | ︙ | |||
394 395 396 397 398 399 400 | options: OF_STRING_SEARCH_BACKWARDS].location; OFString *host; unsigned long long port; if (pos == OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; | | | | | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
options: OF_STRING_SEARCH_BACKWARDS].location;
OFString *host;
unsigned long long port;
if (pos == OF_NOT_FOUND)
@throw [OFInvalidFormatException exception];
host = [proxy substringToIndex: pos];
port = [proxy substringFromIndex: pos + 1]
.unsignedLongLongValue;
if (port > UINT16_MAX)
@throw [OFOutOfRangeException exception];
[OFTCPSocket setSOCKS5Host: host];
[OFTCPSocket setSOCKS5Port: (uint16_t)port];
} @catch (OFInvalidFormatException *e) {
|
| ︙ | ︙ |