Differences From Artifact [48d8bdc4b1]:
- File
src/OFHTTPServer.m
— part of check-in
[2f5af58573]
at
2014-02-13 23:26:17
on branch trunk
— Use -std=c11 instead of -std=gnu11
Not using -std=gnu11 means _GNU_SOURCE does not get defined anymore,
therefore this commit also adds the required feature defines for glibc.Additionally, this adds of_strdup in macros.h, as strdup is an
extension. (user: js, size: 15389) [annotate] [blame] [check-ins using]
To Artifact [7f98124205]:
- File
src/OFHTTPServer.m
— part of check-in
[acc999a75e]
at
2014-05-31 17:57:21
on branch trunk
— OFStream: Add -[hasDataInReadBuffer].
This replaces -[numberOfBytesInReadBuffer], as it's not always known how
many bytes there are exactly and thus the number would often be wrong
(e.g. because data is compressed). (user: js, size: 15398) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
201 202 203 204 205 206 207 | [_socket release]; [_server release]; [super dealloc]; } | | | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | [_socket release]; [_server release]; [super dealloc]; } - (void)OF_sendHeaders { void *pool = objc_autoreleasePoolPush(); OFString *date = [[OFDate date] dateStringWithFormat: @"%a, %d %b %Y %H:%M:%S GMT"]; OFEnumerator *keyEnumerator, *valueEnumerator; OFString *key, *value; |
︙ | ︙ | |||
238 239 240 241 242 243 244 | - (void)lowlevelWriteBuffer: (const void*)buffer length: (size_t)length { void *pool; if (!_headersSent) | | | | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | - (void)lowlevelWriteBuffer: (const void*)buffer length: (size_t)length { void *pool; if (!_headersSent) [self OF_sendHeaders]; if (!_chunked) { [_socket writeBuffer: buffer length: length]; return; } pool = objc_autoreleasePoolPush(); [_socket writeString: [OFString stringWithFormat: @"%zx\r\n", length]]; objc_autoreleasePoolPop(pool); [_socket writeBuffer: buffer length: length]; [_socket writeBuffer: "\r\n" length: 2]; } - (void)close { if (!_headersSent) [self OF_sendHeaders]; if (_chunked) [_socket writeBuffer: "0\r\n\r\n" length: 5]; [_socket close]; |
︙ | ︙ |