From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jul 12 17:50:01 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF383106566B for ; Sun, 12 Jul 2009 17:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 98D7C8FC0C for ; Sun, 12 Jul 2009 17:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n6CHo1i2097265 for ; Sun, 12 Jul 2009 17:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n6CHo1MC097264; Sun, 12 Jul 2009 17:50:01 GMT (envelope-from gnats) Resent-Date: Sun, 12 Jul 2009 17:50:01 GMT Resent-Message-Id: <200907121750.n6CHo1MC097264@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "James E. Flemer" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F659106566B for ; Sun, 12 Jul 2009 17:49:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA248FC0A for ; Sun, 12 Jul 2009 17:49:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n6CHnXY7066703 for ; Sun, 12 Jul 2009 17:49:33 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n6CHnX8R066702; Sun, 12 Jul 2009 17:49:33 GMT (envelope-from nobody) Message-Id: <200907121749.n6CHnX8R066702@www.freebsd.org> Date: Sun, 12 Jul 2009 17:49:33 GMT From: "James E. Flemer" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/136698: [patch] fix ENOTCONN handling in gwenhywfar (socket stalls) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2009 17:50:02 -0000 >Number: 136698 >Category: ports >Synopsis: [patch] fix ENOTCONN handling in gwenhywfar (socket stalls) >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 12 17:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: James E. Flemer >Release: FreeBSD 7.1-STABLE >Organization: >Environment: FreeBSD cage.local 7.1-STABLE FreeBSD 7.1-STABLE #1: Thu Jan 8 20:10:28 PST 2009 root@cage.local:/usr/src/sys/CAGE7-SMP i386 >Description: Gwenhywfar often (always) stalls in TCP connect for me when used in Aqbanking/Gnucash. The attached patches add checks for ENOTCONN conditions in the socket layer, which resolves the stalls. >How-To-Repeat: Install gwenhywfar-3.9.0 and aqbanking-4.1.0 with OFX support. Run the aqbanking setup wizard (qt3-wizard), configure a user for a site that uses https. Click on "Download Accounts". The GUI will hang for a while, and tcpdump will show the socket connection stalls after the 3-way TCP handshake. No data sent on the socket, and eventually something times out and the connection drops. >Fix: With the attached patches, the same test as above works fine. The socket is established, data is sent and received as expected, account list is downloaded. Patch attached with submission follows: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/devel/gwenhywfar/Makefile,v retrieving revision 1.14 diff -u -r1.14 Makefile --- Makefile 22 Jun 2009 20:19:05 -0000 1.14 +++ Makefile 12 Jul 2009 17:44:06 -0000 @@ -7,6 +7,7 @@ PORTNAME= gwenhywfar PORTVERSION= 3.9.0 +PORTREVISION= 1 CATEGORIES= devel net security MASTER_SITES= http://www2.aquamaniac.de/sites/download/ DISTFILES= download.php\?package=01\&release=25\&file=01\&dummy=gwenhywfar-${PORTVERSION}.tar.gz --- /dev/null 2009-07-12 10:44:00.000000000 -0700 +++ files/patch-src::iolayer::io_tls.c 2009-07-12 09:59:44.000000000 -0700 @@ -0,0 +1,20 @@ +# $FreeBSD$ +--- src/iolayer/io_tls.c.orig 2009-06-18 13:56:27.000000000 -0700 ++++ src/iolayer/io_tls.c 2009-07-12 09:56:45.000000000 -0700 +@@ -310,6 +310,7 @@ + if (lflags & GWEN_IO_LAYER_TLS_FLAGS_FORCE_SSL_V3) { + const int proto_prio[2] = { GNUTLS_SSL3, 0 }; + ++ DBG_INFO(GWEN_LOGDOMAIN, "Forcing SSL v3"); + rv=gnutls_protocol_set_priority(xio->session, proto_prio); + if (rv) { + DBG_ERROR(GWEN_LOGDOMAIN, "gnutls_protocol_set_priority: %d (%s)", rv, gnutls_strerror(rv)); +@@ -840,7 +841,7 @@ + + rv=GWEN_Io_LayerCodec_CheckWriteOut(io); + if (rv) { +- if (rv==GWEN_ERROR_TRY_AGAIN) { ++ if (rv==GWEN_ERROR_TRY_AGAIN || rv==GWEN_ERROR_IN_PROGRESS) { + DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv); + #ifdef HAVE_GNUTLS_TRANSPORT_SET_ERRNO + gnutls_transport_set_errno(xio->session, EAGAIN); --- /dev/null 2009-07-12 10:44:00.000000000 -0700 +++ files/patch-src::os::posix::inetsocket.c 2009-07-12 09:59:44.000000000 -0700 @@ -0,0 +1,56 @@ +# $FreeBSD$ +--- src/os/posix/inetsocket.c.orig 2008-07-31 10:56:06.000000000 -0700 ++++ src/os/posix/inetsocket.c 2009-07-12 09:59:23.000000000 -0700 +@@ -74,6 +74,7 @@ + int GWEN_Socket_NetError2GwenError(int rv) { + switch(rv) { + case EINTR: return GWEN_ERROR_INTERRUPTED; ++ case ENOTCONN: + case EWOULDBLOCK: return GWEN_ERROR_TIMEOUT; + case EACCES: + case EPERM: return GWEN_ERROR_PERMISSIONS; +@@ -348,7 +349,7 @@ + if (localSocket->socket==-1) { + GWEN_InetAddr_free(localAddr); + GWEN_Socket_free(localSocket); +- if (errno==EAGAIN) ++ if (errno==EAGAIN || errno==ENOTCONN) + return GWEN_ERROR_TIMEOUT; + else { + DBG_INFO(GWEN_LOGDOMAIN, "accept(): %s", strerror(errno)); +@@ -498,7 +499,7 @@ + assert(bsize); + i=recv(sp->socket,buffer, *bsize,0); + if (i<0) { +- if (errno==EAGAIN) ++ if (errno==EAGAIN || errno==ENOTCONN) + return GWEN_ERROR_TIMEOUT; + else if (errno==EINTR) + return GWEN_ERROR_INTERRUPTED; +@@ -542,7 +543,7 @@ + ); + + if (i<0) { +- if (errno==EAGAIN) ++ if (errno==EAGAIN || errno==ENOTCONN) + return GWEN_ERROR_TIMEOUT; + else if (errno==EINTR) + return GWEN_ERROR_INTERRUPTED; +@@ -594,7 +595,7 @@ + &addrlen); + if (i<0) { + GWEN_InetAddr_free(localAddr); +- if (errno==EAGAIN) ++ if (errno==EAGAIN || errno==ENOTCONN) + return GWEN_ERROR_TIMEOUT; + else if (errno==EINTR) + return GWEN_ERROR_INTERRUPTED; +@@ -632,7 +633,7 @@ + addr->address, + addr->size); + if (i<0) { +- if (errno==EAGAIN) ++ if (errno==EAGAIN || errno==ENOTCONN) + return GWEN_ERROR_TIMEOUT; + else if (errno==EINTR) + return GWEN_ERROR_INTERRUPTED; >Release-Note: >Audit-Trail: >Unformatted: