Skip to content
This repository
Browse code

Adapts the lingering close mechanism to the new events system.

  • Loading branch information...
commit 0c4d1e5772567ccd92f0d11495b44f84946c7735 1 parent 5be7419
Alvaro Lopez Ortega authored January 05, 2012
3  cherokee/connection.c
@@ -1567,6 +1567,9 @@ cherokee_connection_linger_read (cherokee_connection_t *conn)
1567 1567
 			return ret_error;
1568 1568
 		case ret_eagain:
1569 1569
 			TRACE (ENTRIES",linger", "read %u, eagain\n", cnt_read);
  1570
+
  1571
+			conn->polling_aim.fd   = conn->socket.socket;
  1572
+			conn->polling_aim.mode = poll_mode_read;
1570 1573
 			return ret_eagain;
1571 1574
 		case ret_ok:
1572 1575
 			TRACE (ENTRIES",linger", "%u bytes tossed away\n", cnt_read);
4  cherokee/thread.c
@@ -492,7 +492,7 @@ process_polling_connections (cherokee_thread_t *thd)
492 492
 			/* Most likely a 'Gateway Timeout'
493 493
 			 */
494 494
 			if ((conn->phase >= phase_processing_header) ||
495  
-			    (conn->phase == phase_reading_header) && (conn->incoming_header.len >= 1))
  495
+			    ((conn->phase == phase_reading_header) && (conn->incoming_header.len >= 1)))
496 496
 			{
497 497
 				/* Push a hardcoded error
498 498
 				 */
@@ -1343,7 +1343,9 @@ process_active_connections (cherokee_thread_t *thd)
1343 1343
 			ret = cherokee_connection_linger_read (conn);
1344 1344
 			switch (ret) {
1345 1345
 			case ret_ok:
  1346
+				continue;
1346 1347
 			case ret_eagain:
  1348
+				cherokee_thread_deactive_to_polling (thd, conn);
1347 1349
 				continue;
1348 1350
 			case ret_eof:
1349 1351
 			case ret_error:

0 notes on commit 0c4d1e5

Please sign in to comment.
Something went wrong with that request. Please try again.