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;
+ 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)
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);
last_io = time(NULL);
continue;
}
-
- if (reading && FD_ISSET(buffer_f_in, &r_fds)) {
- read_check(buffer_f_in);
- }
}
no_flush--;