Re: [AOLSERVER] Fatal: nssock: select() failed: Bad file descriptor

2003-01-13 Thread Ayan George
Jeff,

I have the exact same problem under Solaris 9.  I'm not sure if
this is related to the problem but I belive nsvhr should NOT
change the ``Connection'' header to ``close'' when poxying over
a unix domain socket (see line 621 of nsvhr.c).

In fact, I think what nsvhr over nsunix does ``proxying'' is a
bit of a streach since nsvhr merely passes the file descrptor of
the HTTP client to the apropriate nsd instance (along with the
headers).

We can probably use a far simpler program to do virtual hosting
over a unix domain socket.  I wrote one just to get a site
working in only about 640 lines of code.

-Ayan

On Fri, 3 Jan 2003, Jeff Rogers wrote:

 I'm getting this rather annoying error quite reproducably.

 I'm running on linux, aolserver 3.5.2 using nsvhr+nsunix (3_5 cvs tags).

 I suspect the error has something to do with http keepalives, even though
 nsvhr should be turning those off.  The problem never comes up when I'm
 browsing my site using IE, but with mozilla as soon as I view a page that
 has more than 1 or 2 images on it, the first image gets loaded, then the
 nsvhr server spits out this error and hangs (doesn't even die gracefully).

 I made the following patch to keep the server running.  It tries to check
 that a fd is actually open before adding it to the select set, and logs a
 bug if its not.  Although in mozilla some connections will still hang, the
 server now keeps running; but this is a workaround and not an actual fix.
 Is there something else that should be fixed?  Is there a better way to
 check that the fd is valid?

 -J

 Index: sock.cpp
 ===
 RCS file: /cvsroot/aolserver/aolserver/nsssl/Attic/sock.cpp,v
 retrieving revision 1.1.2.1
 diff -r1.1.2.1 sock.cpp
 719,724c719,729
  FD_SET(connPtr-sock, set);
  if (max  connPtr-sock) {
  max = connPtr-sock;
  }
  if (timeout  connPtr-closetimeout) {
  timeout = connPtr-closetimeout;
 ---
  if (read(connPtr-sock,NULL,0) == 0) {
  FD_SET(connPtr-sock, set);
  if (max  connPtr-sock) {
  max = connPtr-sock;
  }
  if (timeout  connPtr-closetimeout) {
  timeout = connPtr-closetimeout;
  }
  } else {
  Ns_Log(Bug,read fails: %s,
   ns_sockstrerror(ns_sockerrno));




[AOLSERVER] Fatal: nssock: select() failed: Bad file descriptor

2003-01-03 Thread Jeff Rogers
I'm getting this rather annoying error quite reproducably.

I'm running on linux, aolserver 3.5.2 using nsvhr+nsunix (3_5 cvs tags).

I suspect the error has something to do with http keepalives, even though
nsvhr should be turning those off.  The problem never comes up when I'm
browsing my site using IE, but with mozilla as soon as I view a page that
has more than 1 or 2 images on it, the first image gets loaded, then the
nsvhr server spits out this error and hangs (doesn't even die gracefully).

I made the following patch to keep the server running.  It tries to check
that a fd is actually open before adding it to the select set, and logs a
bug if its not.  Although in mozilla some connections will still hang, the
server now keeps running; but this is a workaround and not an actual fix.
Is there something else that should be fixed?  Is there a better way to
check that the fd is valid?

-J

Index: sock.cpp
===
RCS file: /cvsroot/aolserver/aolserver/nsssl/Attic/sock.cpp,v
retrieving revision 1.1.2.1
diff -r1.1.2.1 sock.cpp
719,724c719,729
 FD_SET(connPtr-sock, set);
 if (max  connPtr-sock) {
 max = connPtr-sock;
 }
 if (timeout  connPtr-closetimeout) {
 timeout = connPtr-closetimeout;
---
 if (read(connPtr-sock,NULL,0) == 0) {
 FD_SET(connPtr-sock, set);
 if (max  connPtr-sock) {
 max = connPtr-sock;
 }
 if (timeout  connPtr-closetimeout) {
 timeout = connPtr-closetimeout;
 }
 } else {
 Ns_Log(Bug,read fails: %s,
  ns_sockstrerror(ns_sockerrno));