Skip to content

Commit 4f1d3e3

Browse files
avargitster
authored andcommitted
pkt-line.[ch]: remove unused packet_buf_write_len()
This function was added in f1f4d8a (pkt-line: add packet_buf_write_len function, 2018-03-15) for use in 0f1dc53 (remote-curl: implement stateless-connect command, 2018-03-15). In a97d007 (remote-curl: use post_rpc() for protocol v2 also, 2019-02-21) that only user of it went away, let's remove it. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af6d1d6 commit 4f1d3e3

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

pkt-line.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,6 @@ void packet_buf_write(struct strbuf *buf, const char *fmt, ...)
252252
va_end(args);
253253
}
254254

255-
void packet_buf_write_len(struct strbuf *buf, const char *data, size_t len)
256-
{
257-
size_t orig_len, n;
258-
259-
orig_len = buf->len;
260-
strbuf_addstr(buf, "0000");
261-
strbuf_add(buf, data, len);
262-
n = buf->len - orig_len;
263-
264-
if (n > LARGE_PACKET_MAX)
265-
die(_("protocol error: impossibly long line"));
266-
267-
set_packet_header(&buf->buf[orig_len], n);
268-
packet_trace(data, len, 1);
269-
}
270-
271255
int write_packetized_from_fd_no_flush(int fd_in, int fd_out)
272256
{
273257
char *buf = xmalloc(LARGE_PACKET_DATA_MAX);

pkt-line.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ void packet_buf_delim(struct strbuf *buf);
2929
void set_packet_header(char *buf, int size);
3030
void packet_write(int fd_out, const char *buf, size_t size);
3131
void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
32-
void packet_buf_write_len(struct strbuf *buf, const char *data, size_t len);
3332
int packet_flush_gently(int fd);
3433
int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
3534
int write_packetized_from_fd_no_flush(int fd_in, int fd_out);

0 commit comments

Comments
 (0)