Add constant for min bufsize for timeout encoding

pull/179/head
Craig Tiller 10 years ago
parent 672cd42a04
commit b7b9c758ed
  1. 3
      src/core/transport/chttp2/timeout_encoding.h
  2. 2
      test/core/transport/chttp2/timeout_encoding_test.c

@ -34,8 +34,11 @@
#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H_
#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H_
#include "src/core/support/string.h"
#include <grpc/support/time.h>
#define GRPC_CHTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE (GPR_LTOA_MIN_BUFSIZE + 1)
/* Encode/decode timeouts to the GRPC over HTTP2 format;
encoding may round up arbitrarily */
void grpc_chttp2_encode_timeout(gpr_timespec timeout, char *buffer);

@ -43,7 +43,7 @@
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__)
static void assert_encodes_as(gpr_timespec ts, const char *s) {
char buffer[32];
char buffer[GRPC_CHTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
grpc_chttp2_encode_timeout(ts, buffer);
gpr_log(GPR_INFO, "check '%s' == '%s'", buffer, s);
GPR_ASSERT(0 == strcmp(buffer, s));

Loading…
Cancel
Save