@@ -98,6 +98,7 @@ HTTPParser.prototype.reinitialize = HTTPParser;
9898HTTPParser . prototype . close =
9999HTTPParser . prototype . pause =
100100HTTPParser . prototype . resume =
101+ HTTPParser . prototype . remove =
101102HTTPParser . prototype . free = function ( ) { } ;
102103HTTPParser . prototype . _compatMode0_11 = false ;
103104HTTPParser . prototype . getAsyncId = function ( ) { return 0 ; } ;
@@ -392,7 +393,7 @@ HTTPParser.prototype.BODY_CHUNKHEAD = function () {
392393
393394HTTPParser . prototype . BODY_CHUNK = function ( ) {
394395 var length = Math . min ( this . end - this . offset , this . body_bytes ) ;
395- this . userCall ( ) ( this [ kOnBody ] ( this . chunk , this . offset , length ) ) ;
396+ this . userCall ( ) ( this [ kOnBody ] ( this . chunk . slice ( this . offset , this . offset + length ) ) ) ;
396397 this . offset += length ;
397398 this . body_bytes -= length ;
398399 if ( ! this . body_bytes ) {
@@ -425,14 +426,13 @@ HTTPParser.prototype.BODY_CHUNKTRAILERS = function () {
425426} ;
426427
427428HTTPParser . prototype . BODY_RAW = function ( ) {
428- var length = this . end - this . offset ;
429- this . userCall ( ) ( this [ kOnBody ] ( this . chunk , this . offset , length ) ) ;
429+ this . userCall ( ) ( this [ kOnBody ] ( this . chunk . slice ( this . offset , this . end ) ) ) ;
430430 this . offset = this . end ;
431431} ;
432432
433433HTTPParser . prototype . BODY_SIZED = function ( ) {
434434 var length = Math . min ( this . end - this . offset , this . body_bytes ) ;
435- this . userCall ( ) ( this [ kOnBody ] ( this . chunk , this . offset , length ) ) ;
435+ this . userCall ( ) ( this [ kOnBody ] ( this . chunk . slice ( this . offset , this . offset + length ) ) ) ;
436436 this . offset += length ;
437437 this . body_bytes -= length ;
438438 if ( ! this . body_bytes ) {
0 commit comments