From c5b149ab1ef546e3a1eac2ed5327957d204ef13b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 22 Feb 2010 22:12:21 -0800 Subject: [PATCH] Add hack to get error event on socket timeout See http://groups.google.com/group/nodejs/browse_thread/thread/4898a1ed3b99dcf0 --- deps/evcom/evcom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deps/evcom/evcom.c b/deps/evcom/evcom.c index 0f48ab0812..1ee02a1f0a 100644 --- a/deps/evcom/evcom.c +++ b/deps/evcom/evcom.c @@ -1018,6 +1018,11 @@ on_timeout (EV_P_ ev_timer *watcher, int revents) if (stream->on_timeout) stream->on_timeout(stream); + // Hack to get error in Node on 'close' event. + // should probably be made into a proper error code. + stream->errorno = 1; + + ev_timer_stop(EV_A_ watcher); evcom_stream_force_close(stream); if (stream->on_close) stream->on_close(stream);