File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,20 @@ class CompressionInputStream {
7070 do {
7171 if ( this . remainingLen ) {
7272 length = this . remainingLen ;
73+ } else if ( this . headerLen === 0 && chunkLen - pos >= 7 ) {
74+ this . header [ 0 ] = chunk [ pos ] ;
75+ this . header [ 1 ] = chunk [ pos + 1 ] ;
76+ this . header [ 2 ] = chunk [ pos + 2 ] ;
77+ this . header [ 3 ] = chunk [ pos + 3 ] ;
78+ this . header [ 4 ] = chunk [ pos + 4 ] ;
79+ this . header [ 5 ] = chunk [ pos + 5 ] ;
80+ this . header [ 6 ] = chunk [ pos + 6 ] ;
81+ this . headerLen = 7 ;
82+ pos += 7 ;
83+ this . compressPacketLen = this . header [ 0 ] + ( this . header [ 1 ] << 8 ) + ( this . header [ 2 ] << 16 ) ;
84+ this . packetLen = this . header [ 4 ] | ( this . header [ 5 ] << 8 ) | ( this . header [ 6 ] << 16 ) ;
85+ if ( this . packetLen === 0 ) this . packetLen = this . compressPacketLen ;
86+ length = this . compressPacketLen ;
7387 } else {
7488 length = null ;
7589 while ( chunkLen - pos > 0 ) {
Original file line number Diff line number Diff line change @@ -128,6 +128,15 @@ class PacketInputStream {
128128 //read header
129129 if ( this . remainingLen ) {
130130 length = this . remainingLen ;
131+ } else if ( this . headerLen === 0 && chunkLen - pos >= 4 ) {
132+ this . header [ 0 ] = chunk [ pos ] ;
133+ this . header [ 1 ] = chunk [ pos + 1 ] ;
134+ this . header [ 2 ] = chunk [ pos + 2 ] ;
135+ this . header [ 3 ] = chunk [ pos + 3 ] ;
136+ pos += 4 ;
137+ this . headerLen = 4 ;
138+ this . packetLen = this . header [ 0 ] + ( this . header [ 1 ] << 8 ) + ( this . header [ 2 ] << 16 ) ;
139+ length = this . packetLen ;
131140 } else {
132141 length = null ;
133142 while ( chunkLen - pos > 0 ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ let baseConfig = {
55 database : 'testn' ,
66 host : 'localhost' ,
77 connectTimeout : 1000 ,
8- port : 3308
8+ port : 3306
99} ;
1010
1111if ( process . env . TEST_HOST ) baseConfig [ 'host' ] = process . env . TEST_HOST ;
You can’t perform that action at this time.
0 commit comments