summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgordon%netscape.com <devnull@localhost>2001-03-16 21:25:19 +0000
committergordon%netscape.com <devnull@localhost>2001-03-16 21:25:19 +0000
commit3c5bc2dcaf5a7fdaaf68eec0aa4a4599ed30daff (patch)
tree307a956c297d9540de4e4cd4030d9c6d059d590c
parent8155f49882424611ddbbe3cd5298f6f9f4b5e2f5 (diff)
downloadnspr-hg-3c5bc2dcaf5a7fdaaf68eec0aa4a4599ed30daff.tar.gz
fix for bug 72038 "FTP listings never stop loading on Mac" by gordon & sfraser. r=dougt, sr=scc.
-rw-r--r--pr/src/md/mac/macsockotpt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pr/src/md/mac/macsockotpt.c b/pr/src/md/mac/macsockotpt.c
index b42e176d..c3fd59ac 100644
--- a/pr/src/md/mac/macsockotpt.c
+++ b/pr/src/md/mac/macsockotpt.c
@@ -1663,10 +1663,13 @@ PRInt32 _MD_writev(PRFileDesc *fd, const struct PRIOVec *iov, PRInt32 iov_size,
static PRBool GetState(PRFileDesc *fd, PRBool *readReady, PRBool *writeReady, PRBool *exceptReady)
{
OTResult resultOT;
- size_t availableData;
-
- resultOT = OTCountDataBytes((EndpointRef)fd->secret->md.osfd, &availableData);
- *readReady = fd->secret->md.readReady && (availableData > 0);
+ // hack to emulate BSD sockets; say that a socket that has disconnected
+ // is still readable.
+ size_t availableData = 1;
+ if (!fd->secret->md.orderlyDisconnect)
+ OTCountDataBytes((EndpointRef)fd->secret->md.osfd, &availableData);
+
+ *readReady = fd->secret->md.readReady && (availableData > 0);
*exceptReady = fd->secret->md.exceptReady;
resultOT = OTGetEndpointState((EndpointRef)fd->secret->md.osfd);