ObjFW  Diff

Differences From Artifact [f1cfec9f86]:

To Artifact [17a72a5d36]:


1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







/*
 * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
 * Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im>
 *
 * 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.
 *
292
293
294
295
296
297
298
299

300
301

302
303
304

305
306
307
308
309
310
311
292
293
294
295
296
297
298

299
300

301
302
303

304
305
306
307
308
309
310
311







-
+

-
+


-
+







- (OFString *)protocolVersionString
{
	return [OFString stringWithFormat: @"%hhu.%hhu",
					   _protocolVersion.major,
					   _protocolVersion.minor];
}

- (OFString *)string
- (OFString *)readString
{
	return [self stringWithEncoding: OFStringEncodingAutodetect];
	return [self readStringWithEncoding: OFStringEncodingAutodetect];
}

- (OFString *)stringWithEncoding: (OFStringEncoding)encoding
- (OFString *)readStringWithEncoding: (OFStringEncoding)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFString *contentType, *contentLengthString, *ret;
	OFData *data;

	if (encoding == OFStringEncodingAutodetect &&
	    (contentType = [_headers objectForKey: @"Content-Type"]) != nil)