-static int queue_packet(struct http_client *hc, const char *buf, size_t len)
-{
- struct queued_packet *qp;
- if (hc->pq_bytes + len > MAX_BACKLOG) {
- http_shutdown_client(hc, "packet queue overrun");
- return -E_QUEUE;
- }
- qp = para_malloc(sizeof(struct queued_packet));
- hc->pq_bytes += len;
- qp->packet = para_malloc(len);
- memcpy(qp->packet, buf, len);
- qp->len = len;
- list_add_tail(&qp->node, &hc->packet_queue);
- PARA_INFO_LOG("%lu bytes queued for fd %d\n", hc->pq_bytes, hc->fd);
- return 1;
-}
-
-static int send_queued_packets(struct http_client *hc)