Jeff King wrote:
> --- a/pkt-line.c
> +++ b/pkt-line.c
> @@ -234,9 +234,10 @@ int packet_get_line(struct strbuf *out,
> *src_len -= 4;
> len -= 4;
>
> - strbuf_add(out, *src_buf, len);
> + if (out)
> + strbuf_add(out, *src_buf, len);
> + packet_trace(*src_buf,
You can use packet_get_line to parse a single packet out of
a stream and into a buffer. However, if you just want to
throw away a set of packets from the stream, there's no need
to even bother copying the bytes. This patch treats a NULL
output buffer as a hint that the caller does not even want
to
2 matches
Mail list logo