Browse Source

Fix ref/unref problem. Was doing opposite of what I should.

v0.7.4-release
Ryan 16 years ago
parent
commit
e4ba665c87
  1. 6
      src/events.cc
  2. 6
      test/mjsunit/test-http-cat.js

6
src/events.cc

@ -86,7 +86,7 @@ Promise::Create (void)
ObjectWrap::InformV8ofAllocation(promise); ObjectWrap::InformV8ofAllocation(promise);
promise->Attach(); promise->Attach();
ev_unref(EV_DEFAULT_UC); ev_ref(EV_DEFAULT_UC);
return promise; return promise;
} }
@ -97,7 +97,7 @@ Promise::EmitSuccess (int argc, v8::Handle<v8::Value> argv[])
bool r = Emit("success", argc, argv); bool r = Emit("success", argc, argv);
Detach(); Detach();
ev_ref(EV_DEFAULT_UC); ev_unref(EV_DEFAULT_UC);
return r; return r;
} }
@ -108,7 +108,7 @@ Promise::EmitError (int argc, v8::Handle<v8::Value> argv[])
bool r = Emit("error", argc, argv); bool r = Emit("error", argc, argv);
Detach(); Detach();
ev_ref(EV_DEFAULT_UC); ev_unref(EV_DEFAULT_UC);
return r; return r;
} }

6
test/mjsunit/test-http-cat.js

@ -18,15 +18,15 @@ var bad_server_got_error = false;
function onLoad () { function onLoad () {
node.http.cat("http://localhost:"+PORT+"/", "utf8") node.http.cat("http://localhost:"+PORT+"/", "utf8")
.addCallback(function (content) { .addCallback(function (content) {
node.debug("got response"); puts("got response");
got_good_server_content = true; got_good_server_content = true;
assertEquals(body, content); assertEquals(body, content);
server.close(); server.close();
}); });
node.http.cat("http://localhost:12312/", "utf8") node.http.cat("http://localhost:12312/", "utf8")
.addErrback(function () { .addErrback(function () {
node.debug("got error (this should happen)"); puts("got error (this should happen)");
bad_server_got_error = true; bad_server_got_error = true;
}); });
} }

Loading…
Cancel
Save