const char *tenc;
int havebody=1;
int isok=1;
+ apr_off_t bb_len;
/*
* Send the AJP request to the remote server
conn->worker->hostname);
return HTTP_SERVICE_UNAVAILABLE;
}
+ conn->worker->s->transfered += bufsiz;
}
}
conn->worker->hostname);
return HTTP_SERVICE_UNAVAILABLE;
}
-
/* parse the reponse */
result = ajp_parse_type(r, conn->data);
output_brigade = apr_brigade_create(p, r->connection->bucket_alloc);
"ajp_send_data_msg failed");
break;
}
+ conn->worker->s->transfered += bufsiz;
} else {
/* something is wrong TC asks for more body but we are
* already at the end of the body data
result = ajp_parse_type(r, conn->data);
}
apr_brigade_destroy(input_brigade);
+
+ apr_brigade_length(output_brigade, 0, &bb_len);
+ if (bb_len != -1)
+ conn->worker->s->readed += bb_len;
+
if (!isok)
apr_brigade_destroy(output_brigade);
int counter, seen_eos, send_chunks;
apr_status_t status;
apr_bucket_brigade *header_brigade, *body_brigade, *input_brigade;
+ apr_off_t transfered = 0;
header_brigade = apr_brigade_create(p, origin->bucket_alloc);
body_brigade = apr_brigade_create(p, origin->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(header_brigade, e);
e = apr_bucket_flush_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(header_brigade, e);
-
+
+ apr_brigade_length(header_brigade, 0, &transfered);
+ if (transfered != -1)
+ conn->worker->s->transfered += transfered;
+ conn->worker->s->transfered += transfered;
if (send_chunks) {
status = ap_pass_brigade(origin->output_filters, header_brigade);
conn->worker->cp->addr, conn->hostname);
return status;
}
-
- apr_brigade_cleanup(body_brigade);
+ apr_brigade_length(body_brigade, 0, &transfered);
+ if (transfered != -1)
+ conn->worker->s->transfered += transfered;
+ apr_brigade_cleanup(body_brigade);
return APR_SUCCESS;
}
static void process_proxy_header(request_rec* r, proxy_server_conf* c,
* response.
*/
rp->proxyreq = PROXYREQ_RESPONSE;
-
do {
apr_brigade_cleanup(bb);
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
+ /* XXX: Is this a real headers length send from remote? */
+ backend->worker->s->readed += len;
/* Is it an HTTP/1 response?
* This is buggy if we ever see an HTTP/1.10
AP_MODE_READBYTES,
APR_BLOCK_READ,
conf->io_buffer_size) == APR_SUCCESS) {
-#if DEBUGGING
- {
apr_off_t readbytes;
apr_brigade_length(bb, 0, &readbytes);
+ backend->worker->s->readed += readbytes;
+#if DEBUGGING
+ {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0,
r->server, "proxy (PID %d): readbytes: %#x",
getpid(), readbytes);