0426cb523a
The downstream connection callback must only be invoked when the event that SSL requests for the connection to make progress has actually occured. Otherwise, the downstream callback might do nothing but re-queue an unrelated event (e.g. in user_net_io_want_write), and the event loop comes around instantly while making no progress. Track the SSL-requested events separately and deliver the required downstream event when they fire. Sample strace: epoll_wait(0, {{EPOLLIN, {u32=96, u64=96}}}, 91, 10000) = 1 : net_ssl_callback in state tls_st_need_write calls cb NET_EVENT_WRITE : User writes data, OpenSSL tries to write data write(96, <snip>..., 170) = -1 EAGAIN (Resource temporarily unavailable) : handle_openssl_error requests NET_EVENT_WRITE epoll_ctl(0, EPOLL_CTL_MOD, 96, {EPOLLOUT, {u32=96, u64=96}}) = 0 : User callback then requests NET_EVENT_READ|NET_EVENT_WRITE epoll_ctl(0, EPOLL_CTL_MOD, 96, {EPOLLIN|EPOLLOUT, {u32=96, u64=96}}) = : Data available for *reading* epoll_wait(0, {{EPOLLIN, {u32=96, u64=96}}}, 91, 10000) = 1 : net_ssl_callback in state tls_st_need_write calls cb NET_EVENT_WRITE : again... |
||
---|---|---|
admin | ||
autotest | ||
cmake/Modules | ||
debian | ||
doc | ||
src | ||
thirdparty | ||
tools | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
AUTHORS | ||
BUGS | ||
ChangeLog | ||
CMakeLists.txt | ||
COPYING | ||
COPYING.OpenSSL | ||
README | ||
TODO |
Welcome and thanks for downloading uHub, a high performance ADC p2p hub. For the official documentation, bugs and other information, please visit: http://www.uhub.org/ For a list of compatible ADC clients, see: http://en.wikipedia.org/wiki/Advanced_Direct_Connect#Client_software