Differences From Artifact [1e27dfeb94]:
- File src/OFHTTPServer.m — part of check-in [481225349f] at 2017-09-24 12:24:23 on branch trunk — OFStream: Add support for async writes (user: js, size: 16803) [annotate] [blame] [check-ins using] [more...]
To Artifact [339d905a8d]:
- File
src/OFHTTPServer.m
— part of check-in
[2f4e0df8be]
at
2017-10-17 00:33:37
on branch trunk
— Do not use implicit method return types
Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (user: js, size: 16887) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
176 177 178 179 180 181 182 | { OFTCPSocket *_socket; OFHTTPServer *_server; OFHTTPRequest *_request; bool _chunked, _headersSent; } | | | | | | | | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | { OFTCPSocket *_socket; OFHTTPServer *_server; OFHTTPRequest *_request; bool _chunked, _headersSent; } - (instancetype)initWithSocket: (OFTCPSocket *)socket server: (OFHTTPServer *)server request: (OFHTTPRequest *)request; @end @implementation OFHTTPServerResponse - (instancetype)initWithSocket: (OFTCPSocket *)socket server: (OFHTTPServer *)server request: (OFHTTPRequest *)request { self = [super init]; _statusCode = 500; _socket = [socket retain]; _server = [server retain]; _request = [request retain]; |
︙ | ︙ | |||
337 338 339 340 341 342 343 | OFString *_host, *_path; uint16_t _port; OFMutableDictionary *_headers; size_t _contentLength; OFMutableData *_body; } | | | | | | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | OFString *_host, *_path; uint16_t _port; OFMutableDictionary *_headers; size_t _contentLength; OFMutableData *_body; } - (instancetype)initWithSocket: (OFTCPSocket *)socket server: (OFHTTPServer *)server; - (bool)socket: (OFTCPSocket *)socket didReadLine: (OFString *)line context: (id)context exception: (id)exception; - (bool)parseProlog: (OFString *)line; - (bool)parseHeaders: (OFString *)line; - (bool)socket: (OFTCPSocket *)socket didReadIntoBuffer: (char *)buffer length: (size_t)length context: (id)context exception: (id)exception; - (bool)sendErrorAndClose: (short)statusCode; - (void)createResponse; @end @implementation OFHTTPServer_Connection - (instancetype)initWithSocket: (OFTCPSocket *)socket server: (OFHTTPServer *)server { self = [super init]; @try { _socket = [socket retain]; _server = [server retain]; _timer = [[OFTimer |
︙ | ︙ | |||
693 694 695 696 697 698 699 | @synthesize host = _host, port = _port, delegate = _delegate, name = _name; + (instancetype)server { return [[[self alloc] init] autorelease]; } | | | 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | @synthesize host = _host, port = _port, delegate = _delegate, name = _name; + (instancetype)server { return [[[self alloc] init] autorelease]; } - (instancetype)init { self = [super init]; _name = @"OFHTTPServer (ObjFW's HTTP server class " @"<https://heap.zone/objfw/>)"; return self; |
︙ | ︙ |