|
@ -605,17 +605,21 @@ stream_send__data (evcom_stream *stream) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (sent <= 0) { |
|
|
if (sent <= 0) { |
|
|
if (errno == EAGAIN || errno == EINTR) { |
|
|
switch (errno) { |
|
|
|
|
|
case EAGAIN: |
|
|
|
|
|
case EINTR: |
|
|
assert(stream->send_action == stream_send__data); |
|
|
assert(stream->send_action == stream_send__data); |
|
|
return AGAIN; |
|
|
return AGAIN; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
stream->errorno = errno; |
|
|
stream->errorno = errno; |
|
|
evcom_perror("send()", errno); |
|
|
evcom_perror("send()", errno); |
|
|
|
|
|
/* pass through */ |
|
|
|
|
|
case EPIPE: |
|
|
stream->send_action = stream_send__close; |
|
|
stream->send_action = stream_send__close; |
|
|
return OKAY; |
|
|
return OKAY; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ev_timer_again(D_LOOP_(stream) &stream->timeout_watcher); |
|
|
ev_timer_again(D_LOOP_(stream) &stream->timeout_watcher); |
|
|
|
|
|
|
|
@ -1151,6 +1155,9 @@ evcom_stream_write (evcom_stream *stream, const char *str, size_t len) |
|
|
|
|
|
|
|
|
if (sent < 0) { |
|
|
if (sent < 0) { |
|
|
switch (errno) { |
|
|
switch (errno) { |
|
|
|
|
|
case EPIPE: |
|
|
|
|
|
goto close; |
|
|
|
|
|
|
|
|
case EINTR: |
|
|
case EINTR: |
|
|
case EAGAIN: |
|
|
case EAGAIN: |
|
|
sent = 0; |
|
|
sent = 0; |
|
|