ObjFW  Check-in [d330801ded]

Overview
Comment:OFHTTPRequest: Add the current date if necessary.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d330801ded28e5e1d1ea0af77ddc5125282793dc7a1b887aefad334953e78558
User & Date: js on 2012-12-11 16:38:35
Other Links: manifest | tags
Context
2012-12-11
23:26
OFStreamObserver_kqueue: Integer overflow check. check-in: 19df6b304d user: js tags: trunk
16:38
OFHTTPRequest: Add the current date if necessary. check-in: d330801ded user: js tags: trunk
14:40
OFHTTPServer: Make the server name configurable. check-in: eea79730f4 user: js tags: trunk
Changes

Modified src/OFHTTPServer.m from [f2e30645b9] to [0de4511755].

476
477
478
479
480
481
482






483
484
485
486
487
488
489
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495







+
+
+
+
+
+







	replyData = [reply data];

	[sock writeFormat: @"HTTP/1.1 %d %s\r\n"
			   @"Server: %@\r\n",
			   [reply statusCode],
			   status_code_to_string([reply statusCode]),
			   [server name]];

	if ([replyHeaders objectForKey: @"Date"] == nil) {
		OFString *date = [[OFDate date]
		    dateStringWithFormat: @"%a, %d %b %Y %H:%M:%S GMT"];
		[sock writeFormat: @"Date: %@\r\n", date];
	}

	if (requestType != OF_HTTP_REQUEST_TYPE_HEAD)
		[sock writeFormat: @"Content-Length: %zu\r\n",
				   [replyData count] * [replyData itemSize]];

	keyEnumerator = [replyHeaders keyEnumerator];
	valueEnumerator = [replyHeaders objectEnumerator];