Author :
Jesse Fang
Date :
2018-02-23 19:01:03
Hash :d22efeb1 Message :bufferevent_socket_connect{,_hostname}() missing event callback and use ret code
[ Upstream commit f7bc1337977553f5f966f13840a5f7feba2d0bd5 ]
- When socket() failed in bufferevent_socket_connect() , the event
callback should be called also in
bufferevent_socket_connect_hostname(). eg. when use
bufferevent_socket_connect_hostname() to resolve and connect an IP
address but process have a smaller ulimit open files, socket() fails
always but caller is not notified.
- When make socket nonblocking failed in bufferevent_socket_connect(),
free the fd.
- Make bufferevent_socket_connect()'s behavior more consistent: function
return error then no callback, function return ok then error passed by
event callback.
Backport-for: 2.0
Refs: #597
Refs: #599
Refs: #600
Closes: #599 (cherry-pick)