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;
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;
}
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;