313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
}
- (void)addHeader: (OFString *)header
{
size_t pos = [header rangeOfString: @":"].location;
OFString *name, *value;
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]
|
|
|
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
}
- (void)addHeader: (OFString *)header
{
size_t pos = [header rangeOfString: @":"].location;
OFString *name, *value;
if (pos == OFNotFound) {
[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]
|
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
|
@try {
size_t pos = [proxy
rangeOfString: @":"
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)
|
|
|
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
|
@try {
size_t pos = [proxy
rangeOfString: @":"
options: OF_STRING_SEARCH_BACKWARDS].location;
OFString *host;
unsigned long long port;
if (pos == OFNotFound)
@throw [OFInvalidFormatException exception];
host = [proxy substringToIndex: pos];
port = [proxy substringFromIndex: pos + 1]
.unsignedLongLongValue;
if (port > UINT16_MAX)
|