File tree 3 files changed +12
-9
lines changed
3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -262,12 +262,12 @@ HTTPConnection::on_message_complete (http_parser *parser)
262
262
263
263
Local<Value> message_handler_v =
264
264
connection->handle_ ->GetHiddenValue (MESSAGE_HANDLER_SYMBOL);
265
- Local<Object> message_handler = message_handler_v->ToObject ();
266
265
connection->handle_ ->DeleteHiddenValue (MESSAGE_HANDLER_SYMBOL);
267
266
267
+ Local<Object> message_handler = message_handler_v->ToObject ();
268
+
268
269
Local<Value> on_msg_complete_v = message_handler->Get (ON_MESSAGE_COMPLETE_SYMBOL);
269
- if (on_msg_complete_v->IsFunction () == false )
270
- return 0 ;
270
+ if (on_msg_complete_v->IsFunction () == false ) return 0 ;
271
271
Handle <Function> on_msg_complete = Handle <Function>::Cast (on_msg_complete_v);
272
272
273
273
TryCatch try_catch;
Original file line number Diff line number Diff line change @@ -296,9 +296,9 @@ node.http.Server = function (RequestHandler, options) {
296
296
return true ;
297
297
} ;
298
298
299
- this . onBodyComplete = function ( ) {
299
+ this . onMessageComplete = function ( ) {
300
300
if ( req . onBodyComplete )
301
- return req . onBodyComplete ( chunk ) ;
301
+ return req . onBodyComplete ( ) ;
302
302
else
303
303
return true ;
304
304
} ;
@@ -464,6 +464,7 @@ node.http.Client = function (port, host) {
464
464
res . headers = headers ;
465
465
466
466
req . responseHandler ( res ) ;
467
+ return true ;
467
468
} ;
468
469
469
470
this . onBody = function ( chunk ) {
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ function onLoad () {
19
19
this . close ( ) ;
20
20
}
21
21
22
- res . sendHeader ( 200 , [ [ "Content-Type" , "text/plain" ] ] ) ;
23
- res . sendBody ( "The path was " + req . uri . path ) ;
24
- res . finish ( ) ;
25
- responses_sent += 1 ;
22
+ req . onBodyComplete = function ( ) {
23
+ res . sendHeader ( 200 , [ [ "Content-Type" , "text/plain" ] ] ) ;
24
+ res . sendBody ( "The path was " + req . uri . path ) ;
25
+ res . finish ( ) ;
26
+ responses_sent += 1 ;
27
+ } ;
26
28
} ) . listen ( PORT ) ;
27
29
28
30
var client = new node . http . Client ( PORT ) ;
You can’t perform that action at this time.
0 commit comments