33//! initialize those clients (e.g. with authentication metadata).
44
55use std:: time:: Duration ;
6- use std:: usize;
76
87use qcs_api_client_common:: configuration:: { ClientConfiguration , TokenError } ;
98#[ cfg( feature = "tracing" ) ]
@@ -28,8 +27,8 @@ pub use qcs_api_client_common::configuration::LoadError;
2827pub use qcs_api_client_grpc:: tonic:: Error as GrpcError ;
2928pub use qcs_api_client_openapi:: apis:: Error as OpenApiError ;
3029
31- /// The maximum size of a gRPC response to the translation service, in bytes.
32- const MAX_TRANSLATION_REQUEST_SIZE : usize = 50 * 1024 * 1024 ;
30+ /// The maximum size of a gRPC request to the translation service, in bytes.
31+ const MAX_TRANSLATION_OUTBOUND_REQUEST_SIZE : usize = 50 * 1024 * 1024 ;
3332
3433/// A type alias for the underlying gRPC connection used by all gRPC clients within this library.
3534/// It is public so that users can create gRPC clients with different APIs using a "raw" connection
@@ -138,9 +137,10 @@ impl Qcs {
138137 #[ cfg( feature = "grpc-web" ) ]
139138 let channel = wrap_channel_with_grpc_web ( service) ;
140139 Ok ( TranslationClient :: new ( channel)
141- . max_encoding_message_size ( MAX_TRANSLATION_REQUEST_SIZE )
142- // do not limit the received response size - practically, the limit is 4Gb.
143- . max_decoding_message_size ( usize:: MAX ) )
140+ . max_encoding_message_size ( MAX_TRANSLATION_OUTBOUND_REQUEST_SIZE )
141+ // do not limit the received response size, although practically the limit is 4Gb due
142+ // to the frame_length of the message being a u32.
143+ . max_decoding_message_size ( u32:: MAX as usize ) )
144144 }
145145}
146146
0 commit comments