ObjFW  Diff

Differences From Artifact [0b0b833434]:

To Artifact [27860baf5d]:


12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26







-
+







 * 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_REQUEST_M
#define OF_HTTP_CLIENT_M

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

#import "OFHTTPClient.h"
#import "OFHTTPRequest.h"
#import "OFString.h"
41
42
43
44
45
46
47
48

49

50
51
52
53
54
55
56
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
56
57







-
+

+








#import "autorelease.h"
#import "macros.h"

Class of_http_client_tls_socket_class = Nil;

static OF_INLINE void
normalize_key(char *str)
normalize_key(char *str_)
{
	uint8_t *str = (uint8_t*)str_;
	BOOL firstLetter = YES;

	while (*str != '\0') {
		if (!isalnum(*str)) {
			firstLetter = YES;
			str++;
			continue;
280
281
282
283
284
285
286

287
288
289
290
291
292
293
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295







+







		normalize_key(keyC);

		@try {
			key = [OFString stringWithUTF8StringNoCopy: keyC
						      freeWhenDone: YES];
		} @catch (id e) {
			free(keyC);
			@throw e;
		}

		do {
			tmp++;
		} while (*tmp == ' ');

		value = [OFString stringWithUTF8String: tmp];