diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-10-30 14:25:00 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-10-30 14:25:00 +0000 |
| commit | 7504527ed2c423a26991bd54595ffdbeed1378b5 (patch) | |
| tree | c0b3b66e3a9898a476eea3819c2cfbe7a91b1f67 /lib/libfetch/common.c | |
| parent | a8ea83bdf1c427c25bf7a8e3e9210b5f07f2111f (diff) | |
Notes
Diffstat (limited to 'lib/libfetch/common.c')
| -rw-r--r-- | lib/libfetch/common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 75f1f308b7ea..1eff41d57f7d 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -544,13 +544,18 @@ int _fetch_putln(conn_t *conn, const char *str, size_t len) { struct iovec iov[2]; + int ret; DEBUG(fprintf(stderr, ">>> %s\n", str)); iov[0].iov_base = __DECONST(char *, str); iov[0].iov_len = len; iov[1].iov_base = __DECONST(char *, ENDL); iov[1].iov_len = sizeof ENDL; - if (_fetch_writev(conn, iov, 2) == -1) + if (len == 0) + ret = _fetch_writev(conn, &iov[1], 1); + else + ret = _fetch_writev(conn, iov, 2); + if (ret == -1) return (-1); return (0); } |
