Index: benchmark/io/http/protocol.cfa
===================================================================
--- benchmark/io/http/protocol.cfa	(revision 7222630ce612aeab2d22e00d0c95d12240cee571)
+++ benchmark/io/http/protocol.cfa	(revision ee59ede130d0876eee5d49e48e5ba64200a46b9c)
@@ -24,4 +24,5 @@
 	"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 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",
@@ -34,4 +35,5 @@
 	400,
 	404,
+	408,
 	413,
 	414,
@@ -49,5 +51,10 @@
 		int ret = cfa_write(fd, it, len, 0, -1`s, 0p, 0p);
 		// int ret = write(fd, it, len);
-		if( ret < 0 ) { if( errno != EAGAIN && errno != EWOULDBLOCK) abort( "'answer error' error: (%d) %s\n", (int)errno, strerror(errno) ); }
+		if( ret < 0 ) {
+			if( errno == ECONNRESET || errno == EPIPE ) return -ECONNRESET;
+			if( errno == EAGAIN || errno == EWOULDBLOCK) return -EAGAIN;
+
+			abort( "'answer error' error: (%d) %s\n", (int)errno, strerror(errno) );
+		}
 
 		// update it/len
@@ -94,5 +101,5 @@
 		if(ret < 0 ) {
 			if( errno == EAGAIN || errno == EWOULDBLOCK) continue READ;
-			// if( errno == EINVAL ) return [E400, true, 0, 0];
+			if( errno == ECONNRESET ) return [E408, true, 0, 0];
 			abort( "read error: (%d) %s\n", (int)errno, strerror(errno) );
 		}
@@ -119,5 +126,5 @@
 }
 
-void sendfile( int pipe[2], int fd, int ans_fd, size_t count ) {
+int sendfile( int pipe[2], int fd, int ans_fd, size_t count ) {
 	unsigned sflags = SPLICE_F_MOVE; // | SPLICE_F_MORE;
 	off_t offset = 0;
@@ -128,4 +135,6 @@
 		if( ret < 0 ) {
 			if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE1;
+			if( errno == ECONNRESET ) return -ECONNRESET;
+			if( errno == EPIPE ) return -EPIPE;
 			abort( "splice [0] error: (%d) %s\n", (int)errno, strerror(errno) );
 		}
@@ -139,4 +148,6 @@
 			if( ret < 0 ) {
 				if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE2;
+				if( errno == ECONNRESET ) return -ECONNRESET;
+				if( errno == EPIPE ) return -EPIPE;
 				abort( "splice [1] error: (%d) %s\n", (int)errno, strerror(errno) );
 			}
@@ -145,4 +156,5 @@
 
 	}
+	return count;
 }
 
Index: benchmark/io/http/protocol.hfa
===================================================================
--- benchmark/io/http/protocol.hfa	(revision 7222630ce612aeab2d22e00d0c95d12240cee571)
+++ benchmark/io/http/protocol.hfa	(revision ee59ede130d0876eee5d49e48e5ba64200a46b9c)
@@ -7,4 +7,5 @@
 	E400,
 	E404,
+	E408,
 	E413,
 	E414,
@@ -21,3 +22,3 @@
 [HttpCode code, bool closed, * const char file, size_t len] http_read(int fd, []char buffer, size_t len, io_cancellation *);
 
-void sendfile( int pipe[2], int fd, int ans_fd, size_t count );
+int sendfile( int pipe[2], int fd, int ans_fd, size_t count );
Index: benchmark/io/http/worker.cfa
===================================================================
--- benchmark/io/http/worker.cfa	(revision 7222630ce612aeab2d22e00d0c95d12240cee571)
+++ benchmark/io/http/worker.cfa	(revision ee59ede130d0876eee5d49e48e5ba64200a46b9c)
@@ -38,5 +38,5 @@
 		if(fd < 0) {
 			if( errno == ECONNABORTED ) break;
-			if( errno == EINVAL && this.done ) break;
+			if( this.done && (errno == EINVAL || errno == EBADF) ) break;
 			abort( "accept error: (%d) %s\n", (int)errno, strerror(errno) );
 		}
@@ -57,9 +57,5 @@
 
 			// if we are done, break out of the loop
-			if( closed ) {
-				if( options.log ) printf("=== Connection closed ===\n");
-				close(fd);
-				continue CONNECTION;
-			}
+			if( closed ) break REQUEST;
 
 			// If this wasn't a request retrun 400
@@ -76,5 +72,6 @@
 
 				// Send the header
-				answer_plain(fd, text, sizeof(text));
+				int ret = answer_plain(fd, text, sizeof(text));
+				if( ret == -ECONNRESET ) break REQUEST;
 
 				if( options.log ) printf("=== Answer sent ===\n");
@@ -86,5 +83,6 @@
 
 				// Send the header
-				answer_empty(fd);
+				int ret = answer_empty(fd);
+				if( ret == -ECONNRESET ) break REQUEST;
 
 				if( options.log ) printf("=== Answer sent ===\n");
@@ -107,11 +105,17 @@
 
 			// Send the header
-			answer_header(fd, count);
+			int ret = answer_header(fd, count);
+			if( ret == -ECONNRESET ) break REQUEST;
 
 			// Send the desired file
-			sendfile( this.pipe, fd, ans_fd, count);
+			ret = sendfile( this.pipe, fd, ans_fd, count);
+			if( ret == -ECONNRESET ) break REQUEST;
 
 			if( options.log ) printf("=== Answer sent ===\n");
 		}
+
+		if( options.log ) printf("=== Connection closed ===\n");
+		close(fd);
+		continue CONNECTION;
 	}
 }
