mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1666 from dwrip/master
feature(grpc-js): Add possibility to provide maxSessionMemory http2 option through ChannelOptions
This commit is contained in:
commit
c3aeb94b8c
|
@ -36,6 +36,7 @@ export interface ChannelOptions {
|
|||
'grpc.enable_http_proxy'?: number;
|
||||
'grpc.http_connect_target'?: string;
|
||||
'grpc.http_connect_creds'?: string;
|
||||
'grpc-node.max_session_memory'?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
@ -59,6 +60,7 @@ export const recognizedOptions = {
|
|||
'grpc.max_send_message_length': true,
|
||||
'grpc.max_receive_message_length': true,
|
||||
'grpc.enable_http_proxy': true,
|
||||
'grpc-node.max_session_memory': true,
|
||||
};
|
||||
|
||||
export function channelOptionsEqual(
|
||||
|
|
|
@ -260,6 +260,9 @@ export class Server {
|
|||
const serverOptions: http2.ServerOptions = {
|
||||
maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER
|
||||
};
|
||||
if ('grpc-node.max_session_memory' in this.options) {
|
||||
serverOptions.maxSessionMemory = this.options['grpc-node.max_session_memory'];
|
||||
}
|
||||
if ('grpc.max_concurrent_streams' in this.options) {
|
||||
serverOptions.settings = {
|
||||
maxConcurrentStreams: this.options['grpc.max_concurrent_streams'],
|
||||
|
|
|
@ -307,6 +307,9 @@ export class Subchannel {
|
|||
let connectionOptions: http2.SecureClientSessionOptions =
|
||||
this.credentials._getConnectionOptions() || {};
|
||||
connectionOptions.maxSendHeaderBlockLength = Number.MAX_SAFE_INTEGER;
|
||||
if ('grpc-node.max_session_memory' in this.options) {
|
||||
connectionOptions.maxSessionMemory = this.options['grpc-node.max_session_memory'];
|
||||
}
|
||||
let addressScheme = 'http://';
|
||||
if ('secureContext' in connectionOptions) {
|
||||
addressScheme = 'https://';
|
||||
|
|
Loading…
Reference in New Issue