mirror of https://github.com/grpc/grpc-node.git
chore: extraneous closure, dont need server ref
This commit is contained in:
parent
0b79b7420a
commit
74102fcc87
|
@ -1191,11 +1191,10 @@ export class Server {
|
||||||
channelzSessionInfo?.streamTracker.addCallFailed();
|
channelzSessionInfo?.streamTracker.addCallFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _channelzHandler(http2Server: http2.Http2Server) {
|
private _channelzHandler(
|
||||||
return (
|
|
||||||
stream: http2.ServerHttp2Stream,
|
stream: http2.ServerHttp2Stream,
|
||||||
headers: http2.IncomingHttpHeaders
|
headers: http2.IncomingHttpHeaders
|
||||||
) => {
|
) {
|
||||||
// for handling idle timeout
|
// for handling idle timeout
|
||||||
this.onStreamOpened(stream);
|
this.onStreamOpened(stream);
|
||||||
|
|
||||||
|
@ -1273,14 +1272,12 @@ export class Server {
|
||||||
details: `Unknown handler type: ${handler.type}`,
|
details: `Unknown handler type: ${handler.type}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _streamHandler(http2Server: http2.Http2Server) {
|
private _streamHandler(
|
||||||
return (
|
|
||||||
stream: http2.ServerHttp2Stream,
|
stream: http2.ServerHttp2Stream,
|
||||||
headers: http2.IncomingHttpHeaders
|
headers: http2.IncomingHttpHeaders
|
||||||
) => {
|
) {
|
||||||
// for handling idle timeout
|
// for handling idle timeout
|
||||||
this.onStreamOpened(stream);
|
this.onStreamOpened(stream);
|
||||||
|
|
||||||
|
@ -1315,7 +1312,6 @@ export class Server {
|
||||||
details: `Unknown handler type: ${handler.type}`,
|
details: `Unknown handler type: ${handler.type}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _runHandlerForCall(
|
private _runHandlerForCall(
|
||||||
|
@ -1361,14 +1357,14 @@ export class Server {
|
||||||
this.serverAddressString = serverAddressString;
|
this.serverAddressString = serverAddressString;
|
||||||
|
|
||||||
const handler = this.channelzEnabled
|
const handler = this.channelzEnabled
|
||||||
? this._channelzHandler(http2Server)
|
? this._channelzHandler
|
||||||
: this._streamHandler(http2Server);
|
: this._streamHandler;
|
||||||
|
|
||||||
const sessionHandler = this.channelzEnabled
|
const sessionHandler = this.channelzEnabled
|
||||||
? this._channelzSessionHandler(http2Server)
|
? this._channelzSessionHandler(http2Server)
|
||||||
: this._sessionHandler(http2Server);
|
: this._sessionHandler(http2Server);
|
||||||
|
|
||||||
http2Server.on('stream', handler);
|
http2Server.on('stream', handler.bind(this));
|
||||||
http2Server.on('session', sessionHandler);
|
http2Server.on('session', sessionHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue