Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions iocore/net/UnixNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,11 @@ write_to_net_io(NetHandler *nh, UnixNetVConnection *vc, EThread *thread)
s->vio.ndone += total_written;
}

// A write of 0 makes no sense since we tried to write more than 0.
ink_assert(r != 0);
// Either we wrote something or got an error.
// check for errors
if (r <= 0) { // if the socket was not ready,add to WaitList
if (r < 0) { // if the socket was not ready, add to WaitList
if (r == -EAGAIN || r == -ENOTCONN) {
NET_INCREMENT_DYN_STAT(net_calls_to_write_nodata_stat);
if ((needs & EVENTIO_WRITE) == EVENTIO_WRITE) {
Expand All @@ -541,12 +544,6 @@ write_to_net_io(NetHandler *nh, UnixNetVConnection *vc, EThread *thread)
return;
}

if (!r || r == -ECONNRESET) {
vc->write.triggered = 0;
write_signal_done(VC_EVENT_EOS, nh, vc);
return;
}

vc->write.triggered = 0;
write_signal_error(nh, vc, (int)-total_written);
return;
Expand Down Expand Up @@ -1001,8 +998,7 @@ UnixNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor &bu
origin_trace_port, (int)r, (int)r, (char *)tiovec[0].iov_base);

} else if (r == 0) {
TraceOut(origin_trace, get_remote_addr(), get_remote_port(), "CLIENT %s:%d closed connection", origin_trace_ip,
origin_trace_port);
TraceOut(origin_trace, get_remote_addr(), get_remote_port(), "CLIENT %s:%d\tbytes=0", origin_trace_ip, origin_trace_port);
} else {
TraceOut(origin_trace, get_remote_addr(), get_remote_port(), "CLIENT %s:%d error=%s", origin_trace_ip, origin_trace_port,
strerror(errno));
Expand Down