From: Andre Noll Date: Sun, 12 Aug 2007 14:31:24 +0000 (+0200) Subject: enqueue_chunk(): pass a struct chunk_queue * instead of struct http_client *. X-Git-Tag: v0.2.17~32 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=34ac5d7569ecf504bd869c0c14cb6abf2c028b13;p=paraslash.git enqueue_chunk(): pass a struct chunk_queue * instead of struct http_client *. --- diff --git a/http_send.c b/http_send.c index 54c59d61..2597066a 100644 --- a/http_send.c +++ b/http_send.c @@ -150,7 +150,7 @@ static int http_send_err_msg(struct http_client *hc) return http_send_msg(hc, HTTP_ERR_MSG); } -static int enqueue_chunk(struct http_client *hc, long unsigned chunk_num, +static int enqueue_chunk(struct chunk_queue *cq, long unsigned chunk_num, size_t sent) { struct queued_chunk *qc; @@ -164,14 +164,14 @@ static int enqueue_chunk(struct http_client *hc, long unsigned chunk_num, return ret; } else buf = vss_get_header(&len); - if (hc->cq.num_pending + len > MAX_BACKLOG) + if (cq->num_pending + len > MAX_BACKLOG) return -E_QUEUE; qc = para_malloc(sizeof(struct queued_chunk)); - hc->cq.num_pending += len; + cq->num_pending += len; qc->chunk_num = chunk_num; qc->sent = sent; - list_add_tail(&qc->node, &hc->cq.q); - PARA_INFO_LOG("%lu bytes queued for fd %d\n", hc->cq.num_pending, hc->fd); + list_add_tail(&qc->node, &cq->q); + PARA_INFO_LOG("%lu bytes queued for q %p\n", cq->num_pending, &cq->q); return 1; } @@ -212,7 +212,7 @@ static int send_queued_chunks(struct http_client *hc) static int queue_chunk_or_shutdown(struct http_client *hc, long unsigned chunk_num, size_t sent) { - int ret = enqueue_chunk(hc, chunk_num, sent); + int ret = enqueue_chunk(&hc->cq, chunk_num, sent); if (ret < 0) http_shutdown_client(hc, "queue error"); return ret;