Disable cqlimit debug, fixed some more bugs with cqlimit.

personal/stbuehler/wip
Stefan Bühler 14 years ago
parent 98a36e970a
commit d8d8c8ea1b
  1. 4
      src/chunk.c
  2. 5
      src/connection.c
  3. 5
      src/modules/mod_fastcgi.c
  4. 4
      src/plugin_core.c

@ -367,12 +367,12 @@ static void cqlimit_update(chunkqueue *cq, goffset d) {
cq->mem_usage += d;
assert(cq->mem_usage >= 0);
cql = cq->limit;
g_printerr("cqlimit_update: cq->mem_usage: %"L_GOFFSET_FORMAT"\n", cq->mem_usage);
/* g_printerr("cqlimit_update: cq->mem_usage: %"L_GOFFSET_FORMAT"\n", cq->mem_usage); */
if (!cql) return;
cql->current += d;
assert(cql->current >= 0);
g_printerr("cqlimit_update: cql->current: %"L_GOFFSET_FORMAT", cql->limit: %"L_GOFFSET_FORMAT"\n", cql->current, cql->limit);
/* g_printerr("cqlimit_update: cql->current: %"L_GOFFSET_FORMAT", cql->limit: %"L_GOFFSET_FORMAT"\n", cql->current, cql->limit); */
if (cql->locked) {
if (cql->limit <= 0 || cql->current < cql->limit) {
cqlimit_unlock(cql);

@ -375,15 +375,14 @@ void connection_reset(connection *con) {
vrequest_reset(con->mainvr);
http_request_parser_reset(&con->req_parser_ctx);
cqlimit_reset(con->raw_in->limit);
cqlimit_reset(con->raw_out->limit);
g_string_truncate(con->remote_addr_str, 0);
g_string_truncate(con->local_addr_str, 0);
con->keep_alive = TRUE;
chunkqueue_reset(con->raw_in);
chunkqueue_reset(con->raw_out);
cqlimit_reset(con->raw_in->limit);
cqlimit_reset(con->raw_out->limit);
if (con->keep_alive_data.link) {
g_queue_delete_link(&con->wrk->keep_alive_queue, con->keep_alive_data.link);

@ -478,10 +478,10 @@ static gboolean fastcgi_get_packet(fastcgi_connection *fcon) {
if (len > fcon->fcgi_in_record.remainingPadding) len = fcon->fcgi_in_record.remainingPadding;
chunkqueue_skip(fcon->fcgi_in, len);
fcon->fcgi_in_record.remainingPadding -= len;
if (0 != fcon->fcgi_in_record.remainingPadding) return TRUE; /* wait for data */
if (0 != fcon->fcgi_in_record.remainingPadding) return FALSE; /* wait for data */
fcon->fcgi_in_record.valid = FALSE; /* read next packet */
} else {
return TRUE; /* wait for/handle more content */
return (fcon->fcgi_in->length > 0); /* wait for/handle more content */
}
}
@ -516,7 +516,6 @@ static gboolean fastcgi_parse_response(fastcgi_connection *fcon) {
plugin *p = fcon->ctx->plugin;
gint len;
while (fastcgi_get_packet(fcon)) {
VR_WARNING(vr, "Fastcgi record type %i", (gint) fcon->fcgi_in_record.type);
if (fcon->fcgi_in_record.version != FCGI_VERSION_1) {
VR_ERROR(vr, "Unknown fastcgi protocol version %i", (gint) fcon->fcgi_in_record.version);
close(fcon->fd);

@ -991,7 +991,7 @@ static action* core_limit_out(server *srv, plugin* p, value *val) {
return NULL;
}
return action_new_function(core_handle_limit_out, NULL, NULL, GINT_TO_POINTER(limit));
return action_new_function(core_handle_limit_out, NULL, NULL, GINT_TO_POINTER((gint) limit));
}
static handler_t core_handle_limit_in(vrequest *vr, gpointer param, gpointer *context) {
@ -1022,7 +1022,7 @@ static action* core_limit_in(server *srv, plugin* p, value *val) {
return NULL;
}
return action_new_function(core_handle_limit_in, NULL, NULL, GINT_TO_POINTER(limit));
return action_new_function(core_handle_limit_in, NULL, NULL, GINT_TO_POINTER((gint) limit));
}

Loading…
Cancel
Save