diff options
author | corvid <devnull@localhost> | 2016-04-09 15:53:21 +0000 |
---|---|---|
committer | corvid <devnull@localhost> | 2016-04-09 15:53:21 +0000 |
commit | 2e31d0502fd10c46fea3eb5e8f52fa3bc8e53f04 (patch) | |
tree | 1aa16917d1ef6fa96fe73a7af58411fb0cf3d3b2 /src/IO/IO.c | |
parent | 17601c3157a73965b23789285953953a54960ce2 (diff) |
if we get an error (e.g. ECONNRESET) while reading, abort the read and show a status message
Diffstat (limited to 'src/IO/IO.c')
-rw-r--r-- | src/IO/IO.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/IO/IO.c b/src/IO/IO.c index 139cf667..4312fddb 100644 --- a/src/IO/IO.c +++ b/src/IO/IO.c @@ -285,6 +285,10 @@ static void IO_fd_read_cb(int fd, void *data) } else { if (IO_callback(io) == 0) a_IOwatch_remove_fd(fd, DIO_READ); + if ((io = IO_get(io_key)) && io->Status) { + /* check io because IO_read OpSend could trigger abort */ + a_IO_ccc(OpAbort, 2, FWD, io->Info, io, NULL); + } } } @@ -443,7 +447,8 @@ void a_IO_ccc(int Op, int Branch, int Dir, ChainLink *Info, dFree(dbuf); break; case OpEnd: - a_Chain_fcb(OpEnd, Info, NULL, NULL); + case OpAbort: + a_Chain_fcb(Op, Info, NULL, NULL); IO_close_fd(io, IO_StopRdWr); /* IO_StopRd would leak FDs */ IO_free(io); dFree(Info); |