Browse Source

remove excess calls to joblist_append()

(recent commits streamlined dynamic handler flow control)
personal/stbuehler/mod-csrf-old
Glenn Strauss 6 years ago
parent
commit
bfac0285a7
  1. 4
      src/connections-glue.c
  2. 3
      src/connections.c
  3. 12
      src/mod_fastcgi.c
  4. 4
      src/network.c
  5. 1
      src/server.c

4
src/connections-glue.c

@ -212,10 +212,8 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
return -2;
} else {
joblist_append(srv, con);
return 0;
}
return 0;
#else
UNUSED(srv);
UNUSED(con);

3
src/connections.c

@ -383,18 +383,15 @@ static int connection_handle_write(server *srv, connection *con) {
con->write_request_ts = srv->cur_ts;
if (con->file_finished) {
connection_set_state(srv, con, CON_STATE_RESPONSE_END);
joblist_append(srv, con);
}
break;
case -1: /* error on our side */
log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed: write failed on fd", con->fd);
connection_set_state(srv, con, CON_STATE_ERROR);
joblist_append(srv, con);
break;
case -2: /* remote close */
connection_set_state(srv, con, CON_STATE_ERROR);
joblist_append(srv, con);
break;
case 1:
con->write_request_ts = srv->cur_ts;

12
src/mod_fastcgi.c

@ -2383,9 +2383,6 @@ range_success: ;
if (have_sendfile2) {
data_string *dcls;
hctx->send_content_body = 0;
joblist_append(srv, con);
/* fix content-length */
if (NULL == (dcls = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
dcls = data_response_init();
@ -2397,6 +2394,7 @@ range_success: ;
con->parsed_response |= HTTP_CONTENT_LENGTH;
con->response.content_length = sendfile2_content_length;
return 200;
}
/* CGI/1.1 rev 03 - 7.2.1.2 */
@ -2614,9 +2612,13 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
/* parse the response header */
if ((ret = fcgi_response_parse(srv, con, p, hctx->response_header))) {
con->http_status = ret;
hctx->send_content_body = 0;
if (200 != ret) { /*(200 returned for X-Sendfile2 handled)*/
con->http_status = ret;
con->mode = DIRECT;
}
con->file_started = 1;
hctx->send_content_body = 0;
fin = 1;
break;
}

4
src/network.c

@ -1070,9 +1070,7 @@ int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq, off_t
off_t limit = con->conf.global_kbytes_per_second * 1024 - *(con->conf.global_bytes_per_second_cnt_ptr);
if (limit <= 0) {
/* we reached the global traffic limit */
con->traffic_limit_reached = 1;
joblist_append(srv, con);
return 1;
} else {
@ -1084,9 +1082,7 @@ int network_write_chunkqueue(server *srv, connection *con, chunkqueue *cq, off_t
off_t limit = con->conf.kbytes_per_second * 1024 - con->bytes_written_cur_second;
if (limit <= 0) {
/* we reached the traffic limit */
con->traffic_limit_reached = 1;
joblist_append(srv, con);
return 1;
} else {

1
src/server.c

@ -1781,7 +1781,6 @@ int main (int argc, char **argv) {
handler = fdevent_get_handler(srv->ev, fd);
context = fdevent_get_context(srv->ev, fd);
/* connection_handle_fdevent needs a joblist_append */
#if 0
log_error_write(srv, __FILE__, __LINE__, "sdd",
"event for", fd, revents);

Loading…
Cancel
Save