0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Add profile window around socket on_read.

This commit is contained in:
Ryan 2009-05-11 17:16:14 +02:00
parent 43531093a3
commit 55d840ea96
2 changed files with 4 additions and 0 deletions

View File

@ -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) {

View File

@ -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);