Browse Source

Properly throw error on failed connection

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
62c4214711
  1. 8
      src/node_net.cc

8
src/node_net.cc

@ -337,7 +337,7 @@ int Connection::AfterResolve(eio_req *req) {
if (address_list) freeaddrinfo(address_list);
// no error. return.
if (req->result == 0) {
if (req->result == 0 && !r) {
evcom_stream_attach(EV_DEFAULT_UC_ &connection->stream_);
goto out;
}
@ -348,7 +348,13 @@ int Connection::AfterResolve(eio_req *req) {
* The fact that I'm modifying a read-only variable here should be
* good evidence of this.
*/
if (req->result) {
connection->stream_.errorno = req->result;
} else {
assert(r);
assert(connection->stream_.errorno);
}
connection->OnClose();

Loading…
Cancel
Save