Эх сурвалжийг харах

transport - Change ~(size_t)0 to macro MAX_SIZE_T

Muxi Yan 8 жил өмнө
parent
commit
ab0d2d4e78

+ 1 - 1
src/core/ext/transport/chttp2/transport/chttp2_transport.c

@@ -2714,7 +2714,7 @@ static grpc_error *incoming_byte_stream_pull(grpc_exec_ctx *exec_ctx,
       if (!grpc_stream_decompress(s->stream_decompression_ctx,
                                   &s->unprocessed_incoming_frames_buffer,
                                   &s->decompressed_data_buffer, NULL,
-                                  ~(size_t)0, &end_of_context)) {
+                                  MAX_SIZE_T, &end_of_context)) {
         error =
             GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream decompression error.");
         return error;

+ 1 - 0
src/core/ext/transport/chttp2/transport/internal.h

@@ -635,6 +635,7 @@ void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx,
                                        grpc_error *error, const char *desc);
 
 #define GRPC_HEADER_SIZE_IN_BYTES 5
+#define MAX_SIZE_T (~(size_t)0)
 
 #define GRPC_CHTTP2_CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
 #define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \

+ 1 - 1
src/core/ext/transport/chttp2/transport/writing.c

@@ -351,7 +351,7 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
                 s->uncompressed_data_size = s->flow_controlled_buffer.length;
                 GPR_ASSERT(grpc_stream_compress(
                     s->stream_compression_ctx, &s->flow_controlled_buffer,
-                    &s->compressed_data_buffer, NULL, ~(size_t)0,
+                    &s->compressed_data_buffer, NULL, MAX_SIZE_T,
                     GRPC_STREAM_COMPRESSION_FLUSH_SYNC));
               }
             }