ObjFW  Diff

Differences From Artifact [530dbe6279]:

To Artifact [aa5274f753]:


29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45







+


-







#import "OFDataArray.h"

#import "OFHTTPRequestFailedException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"
#import "OFInvalidServerReplyException.h"
#import "OFNotImplementedException.h"
#import "OFNotOpenException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFTruncatedDataException.h"
#import "OFUnsupportedProtocolException.h"
#import "OFUnsupportedVersionException.h"
#import "OFWriteFailedException.h"

static OF_INLINE void
normalizeKey(char *str_)
124
125
126
127
128
129
130
131
132
133
134





135
136
137
138
139
140
141
124
125
126
127
128
129
130




131
132
133
134
135
136
137
138
139
140
141
142







-
-
-
-
+
+
+
+
+







		}
	}
}

- (size_t)lowlevelReadIntoBuffer: (void *)buffer
			  length: (size_t)length
{
	if (_atEndOfStream)
		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length
							    errNo: ENOTCONN];
	if (_socket == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_atEndOfStream)
		return 0;

	if (!_hasContentLength && !_chunked)
		return [_socket readIntoBuffer: buffer
					length: length];

	/* Content-Length */
	if (!_chunked) {
227
228
229
230
231
232
233



234
235
236
237
238
239
240
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244







+
+
+








		return 0;
	}
}

- (bool)lowlevelIsAtEndOfStream
{
	if (_socket == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (!_hasContentLength && !_chunked)
		return [_socket isAtEndOfStream];

	return _atEndOfStream;
}

- (int)fileDescriptorForReading