File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,6 @@ function requestHandler(req, res) {
200
200
// 发者模式清除缓存
201
201
cleanCache ( ) ;
202
202
}
203
- if ( req . headers . connection === 'upgrade' && req . headers . upgrade === 'websocket' ) {
204
- // websocket
205
- return ;
206
- }
207
203
res . flush = res . flush || empty ;
208
204
parseGet ( req ) ; // 解析get参数
209
205
doRoute ( req , res ) ; // HTTP路由
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function wsFiller(ws, req) {
50
50
ws . logKey = req . headers [ 'sec-websocket-key' ] || Math . random ( ) ;
51
51
}
52
52
53
- function emitReportLig ( ws , type ) {
53
+ function emitReportLog ( ws , type ) {
54
54
ws . upgradeReq . emit ( type ) ;
55
55
ws . messageTriggerCount = 0 ;
56
56
}
@@ -61,15 +61,15 @@ function reportWebSocketLog(ws, isEnd) {
61
61
// 每次上报log时,先看下Log多不多,不多的话,延迟上报下
62
62
clearTimeout ( ws . logReportTimer ) ;
63
63
if ( isEnd ) {
64
- emitReportLig ( 'reportLog' ) ;
64
+ emitReportLog ( 'reportLog' ) ;
65
65
} else if ( logLength > 30 ) {
66
66
// 立即上报
67
- emitReportLig ( 'reportLogStream' ) ;
67
+ emitReportLog ( 'reportLogStream' ) ;
68
68
} else if ( ws . messageTriggerCount > 9 ) {
69
- emitReportLig ( 'reportLogStream' ) ;
69
+ emitReportLog ( 'reportLogStream' ) ;
70
70
} else {
71
71
ws . logReportTimer = setTimeout ( function ( ) {
72
- emitReportLig ( 'reportLogStream' ) ;
72
+ emitReportLog ( 'reportLogStream' ) ;
73
73
} , 5000 ) ;
74
74
}
75
75
}
You can’t perform that action at this time.
0 commit comments