Index: benchmark/io/http/protocol.cfa
===================================================================
--- benchmark/io/http/protocol.cfa	(revision b664af2f3c72d17c774170f88ee26d3e590b1ec8)
+++ benchmark/io/http/protocol.cfa	(revision 2caed18c49376ad98c5910735a9c912ae2779de1)
@@ -20,19 +20,14 @@
 #include "options.hfa"
 
-const char * volatile date = 0p;
-
-const char * http_msgs[] = {
-	"HTTP/1.1 200 OK\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: %zu \n\n",
-	"HTTP/1.1 400 Bad Request\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-	"HTTP/1.1 404 Not Found\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-	"HTTP/1.1 405 Method Not Allowed\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-	"HTTP/1.1 408 Request Timeout\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-	"HTTP/1.1 413 Payload Too Large\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-	"HTTP/1.1 414 URI Too Long\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
-};
+struct https_msg_str {
+	char msg[512];
+	size_t len;
+};
+
+const https_msg_str * volatile http_msgs[KNOWN_CODES] = { 0 };
 
 _Static_assert( KNOWN_CODES == (sizeof(http_msgs ) / sizeof(http_msgs [0])));
 
-const int http_codes[] = {
+const int http_codes[KNOWN_CODES] = {
 	200,
 	400,
@@ -71,12 +66,14 @@
 	/* paranoid */ assert( code < KNOWN_CODES && code != OK200 );
 	int idx = (int)code;
-	return answer( fd, http_msgs[idx], strlen( http_msgs[idx] ) );
+	return answer( fd, http_msgs[idx]->msg, http_msgs[idx]->len );
 }
 
 int answer_header( int fd, size_t size ) {
-	const char * fmt = http_msgs[OK200];
-	int len = 200;
-	char buffer[len];
-	len = snprintf(buffer, len, fmt, date, size);
+	char buffer[512];
+	char * it = buffer;
+	memcpy(it, http_msgs[OK200]->msg, http_msgs[OK200]->len);
+	it += http_msgs[OK200]->len;
+	int len = http_msgs[OK200]->len;
+	len += snprintf(it, 512 - len, "%d \n\n", size);
 	return answer( fd, buffer, len );
 }
@@ -172,6 +169,16 @@
 #include <thread.hfa>
 
+const char * original_http_msgs[] = {
+	"HTTP/1.1 200 OK\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: ",
+	"HTTP/1.1 400 Bad Request\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+	"HTTP/1.1 404 Not Found\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+	"HTTP/1.1 405 Method Not Allowed\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+	"HTTP/1.1 408 Request Timeout\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+	"HTTP/1.1 413 Payload Too Large\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+	"HTTP/1.1 414 URI Too Long\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
+};
+
 struct date_buffer {
-	char buff[100];
+	https_msg_str strs[KNOWN_CODES];
 };
 
@@ -184,6 +191,6 @@
 	((thread&)this){ "Server Date Thread", *options.clopts.instance[0] };
 	this.idx = 0;
-	memset( this.buffers[0].buff, 0, sizeof(this.buffers[0]) );
-	memset( this.buffers[1].buff, 0, sizeof(this.buffers[1]) );
+	memset( &this.buffers[0], 0, sizeof(this.buffers[0]) );
+	memset( &this.buffers[1], 0, sizeof(this.buffers[1]) );
 }
 
@@ -195,10 +202,18 @@
 		or else {}
 
+
+		char buff[100];
 		Time now = getTimeNsec();
-
-		strftime( this.buffers[this.idx].buff, 100, "%a, %d %b %Y %H:%M:%S %Z", now );
-
-		char * next = this.buffers[this.idx].buff;
-		__atomic_exchange_n((char * volatile *)&date, next, __ATOMIC_SEQ_CST);
+		strftime( buff, 100, "%a, %d %b %Y %H:%M:%S %Z", now );
+
+		for(i; KNOWN_CODES) {
+			size_t len = snprintf( this.buffers[this.idx].strs[i].msg, 512, original_http_msgs[i], buff );
+			this.buffers[this.idx].strs[i].len = len;
+		}
+
+		for(i; KNOWN_CODES) {
+			https_msg_str * next = &this.buffers[this.idx].strs[i];
+			__atomic_exchange_n((https_msg_str * volatile *)&http_msgs[i], next, __ATOMIC_SEQ_CST);
+		}
 		this.idx = (this.idx + 1) % 2;
 
