Browse Source

Was not properly passing the host parameter to Acceptor::Listen.

v0.7.4-release
Ryan 16 years ago
parent
commit
8d00691f78
  1. 6
      src/net.cc

6
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();
}

Loading…
Cancel
Save