ObjFW  Diff

Differences From Artifact [019519d771]:

To Artifact [bee61430ab]:


12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"



#include <string.h>
#include <ctype.h>

#import "OFHTTPServer.h"
#import "OFDataArray.h"
#import "OFDate.h"
#import "OFDictionary.h"







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#define OF_HTTP_SERVER_M

#include <string.h>
#include <ctype.h>

#import "OFHTTPServer.h"
#import "OFDataArray.h"
#import "OFDate.h"
#import "OFDictionary.h"
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
	}
}

static OF_INLINE OFString*
normalized_key(OFString *key)
{
	char *cString = strdup([key UTF8String]);
	char *tmp = cString;
	BOOL firstLetter = YES;

	if (cString == NULL)
		@throw [OFOutOfMemoryException
		    exceptionWithClass: nil
			 requestedSize: strlen([key UTF8String])];








|







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
	}
}

static OF_INLINE OFString*
normalized_key(OFString *key)
{
	char *cString = strdup([key UTF8String]);
	uint8_t *tmp = (uint8_t*)cString;
	BOOL firstLetter = YES;

	if (cString == NULL)
		@throw [OFOutOfMemoryException
		    exceptionWithClass: nil
			 requestedSize: strlen([key UTF8String])];

461
462
463
464
465
466
467
468
469
470
471
472
473
474
475

	reply = [[server delegate] server: server
			didReceiveRequest: request];

	if (reply == nil) {
		[self sendErrorAndClose: 500];
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [[server delegate] class]
			      selector: @selector(server:didReceiveRequest:)];
	}

	replyHeaders = [reply headers];
	replyData = [reply data];

	[sock writeFormat: @"HTTP/1.1 %d %s\r\n"







|







463
464
465
466
467
468
469
470
471
472
473
474
475
476
477

	reply = [[server delegate] server: server
			didReceiveRequest: request];

	if (reply == nil) {
		[self sendErrorAndClose: 500];
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [(id)[server delegate] class]
			      selector: @selector(server:didReceiveRequest:)];
	}

	replyHeaders = [reply headers];
	replyData = [reply data];

	[sock writeFormat: @"HTTP/1.1 %d %s\r\n"