pkt-line: teach packet_read_line to chomp newlines
[gitweb.git] / remote-curl.c
index 7be4b53495647ebf06b50bd22a37678481bfcb3a..b28f96504815224b2b1a06d8d07f0c6ef81c6380 100644 (file)
@@ -308,7 +308,7 @@ static size_t rpc_out(void *ptr, size_t eltsize,
 
        if (!avail) {
                rpc->initial_buffer = 0;
-               avail = packet_read_line(rpc->out, rpc->buf, rpc->alloc);
+               avail = packet_read(rpc->out, rpc->buf, rpc->alloc, 0);
                if (!avail)
                        return 0;
                rpc->pos = 0;
@@ -425,7 +425,7 @@ static int post_rpc(struct rpc_state *rpc)
                        break;
                }
 
-               n = packet_read_line(rpc->out, buf, left);
+               n = packet_read(rpc->out, buf, left, 0);
                if (!n)
                        break;
                rpc->len += n;
@@ -579,7 +579,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)
        rpc->hdr_accept = strbuf_detach(&buf, NULL);
 
        while (!err) {
-               int n = packet_read_line(rpc->out, rpc->buf, rpc->alloc);
+               int n = packet_read(rpc->out, rpc->buf, rpc->alloc, 0);
                if (!n)
                        break;
                rpc->pos = 0;