diff options
author | darin%meer.net <devnull@localhost> | 2004-03-09 23:36:39 +0000 |
---|---|---|
committer | darin%meer.net <devnull@localhost> | 2004-03-09 23:36:39 +0000 |
commit | e16edcbdde9e6ec8c1ec984e0f1449dceb52afb2 (patch) | |
tree | 3d28c3e577f1928af04e9672cda92a2f0653b615 /pr | |
parent | 34667ea7871f6c57982b9b53b0fecd90dc9dfc27 (diff) | |
download | nspr-hg-e16edcbdde9e6ec8c1ec984e0f1449dceb52afb2.tar.gz |
landing patch for bug 231849 "[BEOS] Network optimizations from UNIX" patch by thesuckiestemail@yahoo.se r=wtc,darin
Diffstat (limited to 'pr')
-rw-r--r-- | pr/src/md/beos/bnet.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pr/src/md/beos/bnet.c b/pr/src/md/beos/bnet.c index c4e2beae..0b4fa149 100644 --- a/pr/src/md/beos/bnet.c +++ b/pr/src/md/beos/bnet.c @@ -352,6 +352,21 @@ _MD_send (PRFileDesc *fd, const void *buf, PRInt32 amount, PRInt32 flags, } } +#ifdef BONE_VERSION + /* + * optimization; if bytes sent is less than "amount" call + * select before returning. This is because it is likely that + * the next writev() call will return EWOULDBLOCK. + */ + if ((!fd->secret->nonblocking) && (rv > 0) && (rv < amount) + && (timeout != PR_INTERVAL_NO_WAIT)) { + if (socket_io_wait(osfd, WRITE_FD, timeout) < 0) { + rv = -1; + goto done; + } + } +#endif /* BONE_VERSION */ + if (rv < 0) { _PR_MD_MAP_SEND_ERROR(err); } @@ -451,6 +466,20 @@ PRInt32 _MD_writev( } } + /* + * optimization; if bytes sent is less than "amount" call + * select before returning. This is because it is likely that + * the next writev() call will return EWOULDBLOCK. + */ + if ((!fd->secret->nonblocking) && (rv > 0) && (rv < amount) + && (timeout != PR_INTERVAL_NO_WAIT)) { + if (socket_io_wait(osfd, WRITE_FD, timeout) < 0) { + rv = -1; + goto done; + } + } + + if (rv < 0) { _PR_MD_MAP_WRITEV_ERROR(err); } |