mirror of https://github.com/yandex/odyssey.git
flint: pre-check cancel state for ft_write()
This commit is contained in:
parent
e219cfd107
commit
74fb9d627a
|
@ -47,11 +47,14 @@ FLINT_API int
|
|||
ft_write(ftio_t iop, char *buf, int size, uint64_t time_ms)
|
||||
{
|
||||
ftio *io = iop;
|
||||
ftfiber *current = ft_current(io->f);
|
||||
if (ft_fiber_is_cancel(current))
|
||||
return -ECANCELED;
|
||||
if (!io->connected || io->write_fiber)
|
||||
return -1;
|
||||
io->write_status = 0;
|
||||
io->write_timeout = 0;
|
||||
io->write_fiber = ft_current(io->f);
|
||||
io->write_fiber = current;
|
||||
|
||||
ft_io_timer_start(&io->connect_timer, ft_io_write_timeout_cb,
|
||||
time_ms);
|
||||
|
|
Loading…
Reference in New Issue