Commit f4bcf7d 1 parent 7c45aa1 commit f4bcf7d Copy full SHA for f4bcf7d
File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,12 @@ export class Polling extends Transport {
159
159
160
160
const onEnd = ( buffer ) => {
161
161
this . onData ( buffer . toString ( ) ) ;
162
- this . dataReq = this . dataRes = null ;
162
+ this . onDataRequestCleanup ( ) ;
163
163
res . end ( "ok" ) ;
164
164
} ;
165
165
166
166
res . onAborted ( ( ) => {
167
- this . dataReq = this . dataRes = null ;
167
+ this . onDataRequestCleanup ( ) ;
168
168
this . onError ( "data request connection closed prematurely" ) ;
169
169
} ) ;
170
170
@@ -190,7 +190,7 @@ export class Polling extends Transport {
190
190
if ( totalLength != contentLengthHeader ) {
191
191
this . onError ( "content-length mismatch" ) ;
192
192
res . writeStatus ( "400 content-length mismatch" ) . end ( ) ;
193
- this . dataReq = this . dataRes = null ;
193
+ this . onDataRequestCleanup ( ) ;
194
194
return ;
195
195
}
196
196
onEnd ( buffer ) ;
@@ -201,6 +201,15 @@ export class Polling extends Transport {
201
201
} ) ;
202
202
}
203
203
204
+ /**
205
+ * Cleanup onDataRequest.
206
+ *
207
+ * @api private
208
+ */
209
+ onDataRequestCleanup ( ) {
210
+ this . dataReq = this . dataRes = null ;
211
+ }
212
+
204
213
/**
205
214
* Processes the incoming data payload.
206
215
*
You can’t perform that action at this time.
0 commit comments