From 04f9c9fb095a2b85ecb38348f184fb6f4660192b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20S=C3=B8rensen?= Date: Fri, 13 Nov 2009 14:49:32 +0100 Subject: [PATCH] Supply the strerror as a second arg to the tcp.Connection close event --- src/node_net.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node_net.cc b/src/node_net.cc index 78b17188850..a39af86228e 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -447,10 +447,12 @@ void Connection::OnReceive(const void *buf, size_t len) { void Connection::OnClose() { HandleScope scope; - Handle argv[1]; - argv[0] = stream_.errorno == 0 ? False() : True(); + Handle argv[2] = { + stream_.errorno == 0 ? False() : True(), + String::New(strerror(stream_.errorno)) + }; - Emit("close", 1, argv); + Emit("close", 2, argv); } void Connection::OnConnect() {