Open Oozlum opened 3 years ago
I think using a pcall here breaks under certain environments. I had to do a big workaround in lua-http to make pcall work in Lua 5.1:
Is there some other way we can solve this without a
pcall
?
Yes, actually, but the changes are a bit more invasive. I've committed a different implementation which uses a custom cqueues.socket:onerror handler and changes the internal error mechanism to use the 'return nil, error' convention rather than being assert() based. This allows handling of errors without using pcall.
Prevent errors in protocol.read_response from propagating before the current request has been removed from the fifo. Otherwise all other pipelined requests will become deadlocked.