Browse Source

Add profile window around socket on_read.

v0.7.4-release
Ryan 16 years ago
parent
commit
55d840ea96
  1. 2
      src/net.h
  2. 2
      src/node.cc

2
src/net.h

@ -55,10 +55,12 @@ private:
static void on_read (oi_socket *s, const void *buf, size_t len) {
Connection *connection = static_cast<Connection*> (s->data);
v8::V8::ResumeProfiler();
if (len == 0)
connection->OnEOF();
else
connection->OnReceive(buf, len);
v8::V8::PauseProfiler();
}
static void on_drain (oi_socket *s) {

2
src/node.cc

@ -248,6 +248,8 @@ main (int argc, char *argv[])
Local<Object> g = Context::GetCurrent()->Global();
V8::PauseProfiler(); // to be resumed in Connection::on_read
Local<Object> node = Object::New();
g->Set(String::New("node"), node);

Loading…
Cancel
Save