|
@@ -323,15 +323,14 @@ read:
|
|
|
// goto read_done;
|
|
// goto read_done;
|
|
|
return;
|
|
return;
|
|
|
} else if (err == EMSGSIZE) {
|
|
} else if (err == EMSGSIZE) {
|
|
|
- // ignore
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ nread = len;
|
|
|
} else {
|
|
} else {
|
|
|
// perror("read");
|
|
// perror("read");
|
|
|
io->error = err;
|
|
io->error = err;
|
|
|
goto read_error;
|
|
goto read_error;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (nread == 0) {
|
|
|
|
|
|
|
+ if (nread == 0 && (io->io_type & HIO_TYPE_SOCK_STREAM)) {
|
|
|
goto disconnect;
|
|
goto disconnect;
|
|
|
}
|
|
}
|
|
|
if (nread < len) {
|
|
if (nread < len) {
|
|
@@ -385,7 +384,7 @@ write:
|
|
|
goto write_error;
|
|
goto write_error;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (nwrite == 0) {
|
|
|
|
|
|
|
+ if (nwrite == 0 && (io->io_type & HIO_TYPE_SOCK_STREAM)) {
|
|
|
goto disconnect;
|
|
goto disconnect;
|
|
|
}
|
|
}
|
|
|
pbuf->offset += nwrite;
|
|
pbuf->offset += nwrite;
|
|
@@ -516,12 +515,12 @@ try_write:
|
|
|
goto write_error;
|
|
goto write_error;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (nwrite == 0) {
|
|
|
|
|
- goto disconnect;
|
|
|
|
|
- }
|
|
|
|
|
if (nwrite == len) {
|
|
if (nwrite == len) {
|
|
|
goto write_done;
|
|
goto write_done;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (nwrite == 0 && (io->io_type & HIO_TYPE_SOCK_STREAM)) {
|
|
|
|
|
+ goto disconnect;
|
|
|
|
|
+ }
|
|
|
enqueue:
|
|
enqueue:
|
|
|
hio_add(io, hio_handle_events, HV_WRITE);
|
|
hio_add(io, hio_handle_events, HV_WRITE);
|
|
|
}
|
|
}
|