Skip to content

Commit

Permalink
This branch should make the "pending read number" unnecessary.
Browse files Browse the repository at this point in the history
Hopefully this does not introduce any regression in the SSL support.
  • Loading branch information
alobbs committed Dec 30, 2011
1 parent 78f32a0 commit 7218c34
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 45 deletions.
4 changes: 0 additions & 4 deletions cherokee/connection.c
Expand Up @@ -1194,10 +1194,6 @@ cherokee_connection_recv (cherokee_connection_t *conn,
return ret; return ret;


case ret_eagain: case ret_eagain:
if (cherokee_socket_pending_read (&conn->socket)) {
CONN_THREAD(conn)->pending_read_num += 1;
}

if (cnt_read > 0) { if (cnt_read > 0) {
cherokee_connection_rx_add (conn, cnt_read); cherokee_connection_rx_add (conn, cnt_read);
*len = cnt_read; *len = cnt_read;
Expand Down
19 changes: 0 additions & 19 deletions cherokee/socket.c
Expand Up @@ -822,25 +822,6 @@ cherokee_socket_read (cherokee_socket_t *socket,
} }




int
cherokee_socket_pending_read (cherokee_socket_t *socket)
{
if (socket->is_tls != TLS)
return 0;

if (unlikely ((socket->status != socket_reading) &&
(socket->status != socket_writing)))
return 0;

if (socket->cryptor != NULL) {
return cherokee_cryptor_socket_pending (socket->cryptor);
}

SHOULDNT_HAPPEN;
return 0;
}


ret_t ret_t
cherokee_socket_flush (cherokee_socket_t *socket) cherokee_socket_flush (cherokee_socket_t *socket)
{ {
Expand Down
1 change: 0 additions & 1 deletion cherokee/socket.h
Expand Up @@ -122,7 +122,6 @@ ret_t cherokee_socket_shutdown (cherokee_socket_t *socket, int how);
ret_t cherokee_socket_reset (cherokee_socket_t *socket); ret_t cherokee_socket_reset (cherokee_socket_t *socket);
ret_t cherokee_socket_accept (cherokee_socket_t *socket, cherokee_socket_t *server_socket); ret_t cherokee_socket_accept (cherokee_socket_t *socket, cherokee_socket_t *server_socket);
ret_t cherokee_socket_accept_fd (cherokee_socket_t *socket, int *new_fd, cherokee_sockaddr_t *sa); ret_t cherokee_socket_accept_fd (cherokee_socket_t *socket, int *new_fd, cherokee_sockaddr_t *sa);
int cherokee_socket_pending_read (cherokee_socket_t *socket);
ret_t cherokee_socket_flush (cherokee_socket_t *socket); ret_t cherokee_socket_flush (cherokee_socket_t *socket);
ret_t cherokee_socket_test_read (cherokee_socket_t *socket); ret_t cherokee_socket_test_read (cherokee_socket_t *socket);


Expand Down
20 changes: 0 additions & 20 deletions cherokee/thread.c
Expand Up @@ -166,7 +166,6 @@ cherokee_thread_new (cherokee_thread_t **thd,
n->reuse_list_num = 0; n->reuse_list_num = 0;


n->pending_conns_num = 0; n->pending_conns_num = 0;
n->pending_read_num = 0;


n->fastcgi_servers = NULL; n->fastcgi_servers = NULL;
n->fastcgi_free_func = NULL; n->fastcgi_free_func = NULL;
Expand Down Expand Up @@ -729,13 +728,6 @@ process_active_connections (cherokee_thread_t *thd)
case ret_ok: case ret_ok:
TRACE(ENTRIES, "Handshake %s\n", "finished"); TRACE(ENTRIES, "Handshake %s\n", "finished");


/* The client might have sent the request on the same
* package as the last piece of the handshake. Thus,
* the server shouldn't stop on fdpoll->watch(), the
* connection is marked as ready as well.
*/
thd->pending_read_num++;

/* Set mode and update timeout /* Set mode and update timeout
*/ */
conn_set_mode (thd, conn, socket_reading); conn_set_mode (thd, conn, socket_reading);
Expand Down Expand Up @@ -1716,18 +1708,12 @@ cherokee_thread_step_SINGLE_THREAD (cherokee_thread_t *thd)


/* Be quick when there are pending work: /* Be quick when there are pending work:
* - pending_conns_num: Pipelined requests * - pending_conns_num: Pipelined requests
* - pending_read_num: SSL pending reads
*/ */
if (thd->pending_conns_num > 0) { if (thd->pending_conns_num > 0) {
fdwatch_msecs = 0; fdwatch_msecs = 0;
thd->pending_conns_num = 0; thd->pending_conns_num = 0;
} }


if (thd->pending_read_num > 0) {
fdwatch_msecs = 0;
thd->pending_read_num = 0;
}

if (! cherokee_list_empty (&thd->active_list)) { if (! cherokee_list_empty (&thd->active_list)) {
fdwatch_msecs = 0; fdwatch_msecs = 0;
} }
Expand Down Expand Up @@ -1907,18 +1893,12 @@ cherokee_thread_step_MULTI_THREAD (cherokee_thread_t *thd,


/* Be quick when there are pending work: /* Be quick when there are pending work:
* - pending_conns_num: Pipelined requests * - pending_conns_num: Pipelined requests
* - pending_read_num: SSL pending reads
*/ */
if (thd->pending_conns_num > 0) { if (thd->pending_conns_num > 0) {
fdwatch_msecs = 0; fdwatch_msecs = 0;
thd->pending_conns_num = 0; thd->pending_conns_num = 0;
} }


if (thd->pending_read_num > 0) {
fdwatch_msecs = 0;
thd->pending_read_num = 0;
}

if (! cherokee_list_empty (&thd->active_list)) { if (! cherokee_list_empty (&thd->active_list)) {
fdwatch_msecs = 0; fdwatch_msecs = 0;
} }
Expand Down
1 change: 0 additions & 1 deletion cherokee/thread.h
Expand Up @@ -84,7 +84,6 @@ typedef struct {
cherokee_boolean_t is_full; cherokee_boolean_t is_full;


int pending_conns_num; /* Waiting pipelining connections */ int pending_conns_num; /* Waiting pipelining connections */
int pending_read_num; /* Conns with SSL deping read */


cherokee_avl_t *fastcgi_servers; cherokee_avl_t *fastcgi_servers;
cherokee_func_free_t fastcgi_free_func; cherokee_func_free_t fastcgi_free_func;
Expand Down

0 comments on commit 7218c34

Please sign in to comment.