scsh-hackers
[Top] [All Lists]

[Scsh-hackers] [ scsh-Bugs-428050 ] maybe read-string/partial bug??

To: noreply@sourceforge.net
Subject: [Scsh-hackers] [ scsh-Bugs-428050 ] maybe read-string/partial bug??
From: noreply@sourceforge.net
Date: Mon, 28 May 2001 13:21:32 -0700
List-id: Discussion among the implementors <scsh-hackers.lists.sourceforge.net>
Sender: scsh-hackers-admin@lists.sourceforge.net
Bugs item #428050, was updated on 2001-05-28 13:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110493&aid=428050&group_id=10493

Category: run-time
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian D. Carlstrom (bdc)
Assigned to: Brian D. Carlstrom (bdc)
Summary: maybe read-string/partial bug??

Initial Comment:
From: "Robert E. Brown" <brownb@jany.gs.com>
To: scsh-bugs@zurich.ai.mit.edu
Subject: maybe read-string/partial bug??
Date: Tue, 26 Oct 1999 16:49:31 -0400


I'm running scsh 0.5.2 on a Linux box -- Red Hat 
version 6.0.

I've written a little server that uses read-
string/partial to get data from
clients.  The server waits in select until data is 
available, then reads
from the sockets that select has indicated are 
readable.

Sometimes, the read system call on a client socket 
returns -1 with errno set
to ECONNRESET, since a client has closed its 
communications socket.

The code in generic-read-string!/partial does not 
catch this case, so my
server was dying.  Is this a bug in read-
string/partial?

I now wrap read-string/partial as follows, which has 
made the problem go
away:

     (define (read-carefully port)
       (with-errno-handler
        ((err data) ((errno/connreset) #f))
        (read-string/partial 1024 port)))

Is this the right approach?

                                bob




----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110493&aid=428050&group_id=10493


<Prev in Thread] Current Thread [Next in Thread>