Differences From Artifact [0ddfcecf31]:
- File src/OFHTTPServer.m — part of check-in [c8877fd278] at 2015-05-23 11:21:43 on branch trunk — OFHTTPRequest: Rename entity to body (user: js, size: 15989) [annotate] [blame] [check-ins using]
To Artifact [aed0368bbf]:
- File
src/OFHTTPServer.m
— part of check-in
[cec0f072f8]
at
2016-01-03 00:43:58
on branch 0.8
— Update copyright
While at it, also update the mail address. (user: js, size: 16110) [annotate] [blame] [check-ins using]
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 * Jonathan Schleifer <js@heap.zone> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
| ︙ | ︙ | |||
449 450 451 452 453 454 455 |
_state = PARSING_HEADERS;
return true;
}
- (bool)parseHeaders: (OFString*)line
{
| | | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
_state = PARSING_HEADERS;
return true;
}
- (bool)parseHeaders: (OFString*)line
{
OFString *key, *value, *old;
size_t pos;
if ([line length] == 0) {
intmax_t contentLength;
@try {
contentLength = [[_headers
|
| ︙ | ︙ | |||
495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
key = [line substringWithRange: of_range(0, pos)];
value = [line substringWithRange:
of_range(pos + 1, [line length] - pos - 1)];
key = normalizedKey([key stringByDeletingTrailingWhitespaces]);
value = [value stringByDeletingLeadingWhitespaces];
[_headers setObject: value
forKey: key];
if ([key isEqual: @"Host"]) {
pos = [value
rangeOfString: @":"
options: OF_STRING_SEARCH_BACKWARDS].location;
| > > > > | 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
key = [line substringWithRange: of_range(0, pos)];
value = [line substringWithRange:
of_range(pos + 1, [line length] - pos - 1)];
key = normalizedKey([key stringByDeletingTrailingWhitespaces]);
value = [value stringByDeletingLeadingWhitespaces];
old = [_headers objectForKey: key];
if (old != nil)
value = [old stringByAppendingFormat: @",%@", value];
[_headers setObject: value
forKey: key];
if ([key isEqual: @"Host"]) {
pos = [value
rangeOfString: @":"
options: OF_STRING_SEARCH_BACKWARDS].location;
|
| ︙ | ︙ |