Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
86ffe37
)
prioritise reading over writing in the select loop. (this is another
author
Andrew Tridgell
<tridge@samba.org>
Thu, 2 Jul 1998 02:59:04 +0000
(
02:59
+0000)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 2 Jul 1998 02:59:04 +0000
(
02:59
+0000)
ssh-friendly attempt)
io.c
patch
|
blob
|
blame
|
history
diff --git
a/io.c
b/io.c
index
469eef3
..
2575dc4
100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-323,14
+323,15
@@
static void writefd_unbuffered(int fd,char *buf,int len)
no_flush++;
no_flush++;
- reading = (buffer_f_in != -1 && read_buffer_len < MAX_READ_BUFFER);
-
while (total < len) {
FD_ZERO(&w_fds);
FD_ZERO(&r_fds);
FD_SET(fd,&w_fds);
fd_count = fd+1;
while (total < len) {
FD_ZERO(&w_fds);
FD_ZERO(&r_fds);
FD_SET(fd,&w_fds);
fd_count = fd+1;
+ reading = (buffer_f_in != -1 &&
+ read_buffer_len < MAX_READ_BUFFER);
+
if (reading) {
FD_SET(buffer_f_in,&r_fds);
if (buffer_f_in > fd)
if (reading) {
FD_SET(buffer_f_in,&r_fds);
if (buffer_f_in > fd)
@@
-350,6
+351,10
@@
static void writefd_unbuffered(int fd,char *buf,int len)
continue;
}
continue;
}
+ if (reading && FD_ISSET(buffer_f_in, &r_fds)) {
+ read_check(buffer_f_in);
+ }
+
if (FD_ISSET(fd, &w_fds)) {
int n = (len-total)>>blocked;
int ret = write(fd,buf+total,n?n:1);
if (FD_ISSET(fd, &w_fds)) {
int n = (len-total)>>blocked;
int ret = write(fd,buf+total,n?n:1);
@@
-377,10
+382,6
@@
static void writefd_unbuffered(int fd,char *buf,int len)
last_io = time(NULL);
continue;
}
last_io = time(NULL);
continue;
}
-
- if (reading && FD_ISSET(buffer_f_in, &r_fds)) {
- read_check(buffer_f_in);
- }
}
no_flush--;
}
no_flush--;