From owner-freebsd-openoffice Thu Aug 15 13:27:19 2002 Delivered-To: freebsd-openoffice@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14EDC37B400 for ; Thu, 15 Aug 2002 13:27:16 -0700 (PDT) Received: from tomts17-srv.bellnexxia.net (tomts17.bellnexxia.net [209.226.175.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23A5843E6E for ; Thu, 15 Aug 2002 13:27:15 -0700 (PDT) (envelope-from kevin.hendricks@sympatico.ca) Received: from localhost.localdomain ([65.93.133.235]) by tomts17-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020815202714.KZMR4312.tomts17-srv.bellnexxia.net@localhost.localdomain>; Thu, 15 Aug 2002 16:27:14 -0400 Content-Type: text/plain; charset="iso-8859-1" From: "Kevin B. Hendricks" To: dev@porting.openoffice.org, Martin Blapp Subject: Re: [porting-dev] FreeBSD and webdav problems Date: Thu, 15 Aug 2002 16:23:37 -0400 X-Mailer: KMail [version 1.4] Cc: References: <20020815171253.Y17516-100000@levais.imp.ch> In-Reply-To: <20020815171253.Y17516-100000@levais.imp.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200208151623.37127.kevin.hendricks@sympatico.ca> Sender: owner-freebsd-openoffice@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, The question I have here is why this socket is set to be non-blocking. Is this something port specific for FreeBSD? Where is the f cntl done on the socket fd that makes it non-blocking? If not non-blocking, then connect should block and wait and not return EINPROGRESS. I can not find any code that sets things up to be non-blocking (perhaps that is a default under FreeBSD?) or I missed it someplace. Kevin On August 15, 2002 11:22, Martin Blapp wrote: > Hi all, > > I see some strange behaviour here with webdav. A connection > does loop here: external/neon/rtufiles/socket.c > > nsocket *sock_connect(const struct in_addr addr, > unsigned short int portnum) > { > struct sockaddr_in sa; > int fd; > > /* Create the socket */ > fd = socket(AF_INET, SOCK_STREAM, 0); > if (fd < 0) > return NULL; > /* Connect the nsocket */ > sa.sin_family = AF_INET; > sa.sin_port = htons(portnum); /* host -> net byte orders */ > sa.sin_addr = addr; > if (connect(fd, (struct sockaddr *)&sa, sizeof(struct sockaddr_in)) > < 0) { (void) NEON_CLOSE(fd); > return NULL; > } > /* Success - return the nsocket */ > return create_sock(fd); > } > > Breakpoint 1, sock_connect (addr={s_addr = 80}, portnum=80) at > socket.c:703 703 fd = socket(AF_INET, SOCK_STREAM, 0); > (gdb) c > Continuing. > > Breakpoint 4, 0x28bc0d4d in connect () from /usr/lib/libc_r.so.4 > (gdb) c > Continuing. > > Breakpoint 3, sock_close (sock=0x81db870) at socket.c:872 > 872 ret = NEON_CLOSE(sock->fd); > (gdb) c > Continuing. > > Breakpoint 1, sock_connect (addr={s_addr = 80}, portnum=80) at > socket.c:703 703 fd = socket(AF_INET, SOCK_STREAM, 0); > (gdb) c > Continuing. > > Breakpoint 4, 0x28bc0d4d in connect () from /usr/lib/libc_r.so.4 > > (gdb) p errno > $11 = 36 > > connect() returns EINPROGRESS. > > [EINPROGRESS] The socket is non-blocking and the connection cannot > be completed immediately. It is possible to > select(2) for completion by selecting the socket for writing. > > This is not handled by the webdav code and so we get into > and endless loop. > > How does this work on other platforms ? > > Martin > > Martin Blapp, > ------------------------------------------------------------------ > ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH > Phone: +41 061 826 93 00: +41 61 826 93 01 > PGP: > PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E > ------------------------------------------------------------------ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@porting.openoffice.org > For additional commands, e-mail: dev-help@porting.openoffice.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-openoffice" in the body of the message