From owner-freebsd-current Tue Oct 29 19:12:39 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD8B637B401 for ; Tue, 29 Oct 2002 19:12:37 -0800 (PST) Received: from stash.attlabs.att.com (mpfg.attlabs.net [12.106.35.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35FBF43E75 for ; Tue, 29 Oct 2002 19:12:37 -0800 (PST) (envelope-from fenner@research.att.com) Received: from stash.attlabs.att.com (localhost [IPv6:::1]) by stash.attlabs.att.com (8.12.6/8.12.6) with ESMTP id g9U3CQAD021758 for ; Tue, 29 Oct 2002 19:12:26 -0800 (PST) (envelope-from fenner@stash.attlabs.att.com) Received: (from fenner@localhost) by stash.attlabs.att.com (8.12.6/8.12.6/Submit) id g9U3CPZs021756 for freebsd-current@freebsd.org; Tue, 29 Oct 2002 19:12:25 -0800 (PST) (envelope-from fenner) Date: Tue, 29 Oct 2002 19:12:25 -0800 (PST) From: Bill Fenner Message-Id: <200210300312.g9U3CPZs021756@stash.attlabs.att.com> To: freebsd-current@freebsd.org Subject: libfetch(3) patch for SSL Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Turns out my writev patch for fetch broke SSL, since it could create iov[0].iov_len = 0, which would cause SSL_write(..,0), which would return 0, which would look like a short write and cause an error, which then gets ignored by http.c . Ignoring the bigger picture of the error checking, this fix at least gets https: working again by making sure that _fetch_putln doesn't construct an iov with iov_len == 0. (Yes, this is against rev 1.40, post-brouhaha). Bill Index: common.c =================================================================== RCS file: /home/ncvs/src/lib/libfetch/common.c,v retrieving revision 1.40 diff -u -r1.40 common.c --- common.c 30 Oct 2002 00:17:16 -0000 1.40 +++ common.c 30 Oct 2002 03:06:58 -0000 @@ -539,13 +539,18 @@ _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); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message