From 8d00691f7843c3ef136919e5e996096def8d6046 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 13 May 2009 23:44:05 +0200 Subject: [PATCH] Was not properly passing the host parameter to Acceptor::Listen. --- src/net.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net.cc b/src/net.cc index f17ba834313..347de15a3bf 100644 --- a/src/net.cc +++ b/src/net.cc @@ -435,14 +435,14 @@ Acceptor::v8Listen (const Arguments& args) if (args.Length() < 1) return ThrowException(String::New("Must give at least a port as argument.")); - char *host = NULL; HandleScope scope; String::AsciiValue port(args[0]->ToString()); + char *host = NULL; if (args[1]->IsString()) { String::Utf8Value host_sv(args[1]->ToString()); - host = *host_sv; + host = strdup(*host_sv); } // For servers call getaddrinfo inline. This is blocking but it shouldn't @@ -453,6 +453,8 @@ Acceptor::v8Listen (const Arguments& args) if (r != 0) return ThrowException(String::New(strerror(errno))); + free(host); + acceptor->Listen(address); return Undefined(); }