Skip to content
Snippets Groups Projects
Commit 0b231d7c authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

A fix for gh-361: new sockets don't respect fiber cancel.

Add a testcancel() call to iowait().
A test case will be added to 1.6, where it's easier to do.
parent 10186f8c
No related branches found
No related tags found
No related merge requests found
......@@ -427,7 +427,9 @@ lbox_bsdsocket_iowait(struct lua_State *L)
ev_set_priority(&io, EV_MAXPRI);
ev_io_start(&io);
fiber_setcancellable(true);
fiber_yield_timeout(timeout);
fiber_setcancellable(false);
ev_io_stop(&io);
int ret = 0;
......
......@@ -180,6 +180,7 @@ local function wait_safely(self, what, timeout)
self.waiters[fid] = f
local res = box.socket.internal.iowait(self.fh, what, timeout)
self.waiters[fid] = nil
box.fiber.testcancel()
return res
end
......
......@@ -219,7 +219,7 @@ lua s:getsockopt('SOL_SOCKET', 'SO_DEBUG')
...
lua s:setsockopt('SOL_SOCKET', 'SO_ACCEPTCONN', 1)
---
error: '[string "-- bsdsocket.lua (internal file)..."]:321: Socket option SO_ACCEPTCONN is read only'
error: '[string "-- bsdsocket.lua (internal file)..."]:322: Socket option SO_ACCEPTCONN is read only'
...
lua s:getsockopt('SOL_SOCKET', 'SO_RCVBUF') > 32
---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment