diff options
author | wtc%netscape.com <devnull@localhost> | 1999-12-29 22:19:53 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-12-29 22:19:53 +0000 |
commit | 2074f84c9a45635173d3b8f5bff1f2ead05bd5b7 (patch) | |
tree | 5da6e6b6f297d45ee6966df0737464dea70284a8 | |
parent | eb0e6811974d6988307fb437404213172ae4e994 (diff) | |
download | nspr-hg-2074f84c9a45635173d3b8f5bff1f2ead05bd5b7.tar.gz |
Bugzilla bug #22549: made PR_Read/PR_Write for sockets equivalent to
PR_Recv/PR_Send with infinite timeout. r=colin@theblakes.com,
srinivas@netscape.com
-rw-r--r-- | pr/src/pthreads/ptio.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index 53fc4c66..f3a8e276 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -1453,6 +1453,11 @@ static PRInt32 pt_Read(PRFileDesc *fd, void *buf, PRInt32 amount) return bytes; } /* pt_Read */ +static PRInt32 pt_SocketRead(PRFileDesc *fd, void *buf, PRInt32 amount) +{ + return pt_Recv(fd, buf, amount, 0, PR_INTERVAL_NO_TIMEOUT); +} /* pt_SocketRead */ + static PRInt32 pt_Write(PRFileDesc *fd, const void *buf, PRInt32 amount) { PRInt32 syserrno, bytes = -1; @@ -1495,6 +1500,11 @@ static PRInt32 pt_Write(PRFileDesc *fd, const void *buf, PRInt32 amount) return bytes; } /* pt_Write */ +static PRInt32 pt_SocketWrite(PRFileDesc *fd, const void *buf, PRInt32 amount) +{ + return pt_Send(fd, buf, amount, 0, PR_INTERVAL_NO_TIMEOUT); +} /* pt_SocketWrite */ + static PRInt32 pt_Writev( PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_len, PRIntervalTime timeout) { @@ -2940,8 +2950,8 @@ static PRIOMethods _pr_pipe_methods = { static PRIOMethods _pr_tcp_methods = { PR_DESC_SOCKET_TCP, pt_Close, - pt_Read, - pt_Write, + pt_SocketRead, + pt_SocketWrite, pt_Available_s, pt_Available64_s, pt_Synch, @@ -2979,8 +2989,8 @@ static PRIOMethods _pr_tcp_methods = { static PRIOMethods _pr_udp_methods = { PR_DESC_SOCKET_UDP, pt_Close, - pt_Read, - pt_Write, + pt_SocketRead, + pt_SocketWrite, pt_Available_s, pt_Available64_s, pt_Synch, |