diff options
author | des <des@FreeBSD.org> | 2002-10-30 14:25:00 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-10-30 14:25:00 +0000 |
commit | 216181b0220af9c25cd3a930d93e7800d6b04a98 (patch) | |
tree | c0b3b66e3a9898a476eea3819c2cfbe7a91b1f67 /lib | |
parent | 73becfabb7a57eee39a467b1cc913de188e1129a (diff) | |
download | FreeBSD-src-216181b0220af9c25cd3a930d93e7800d6b04a98.zip FreeBSD-src-216181b0220af9c25cd3a930d93e7800d6b04a98.tar.gz |
Fix a bug in fenner's _fetch_writev() patch (rev 1.36)
Submitted by: fenner
Diffstat (limited to 'lib')
-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 75f1f30..1eff41d 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); } |