From 2b4c9db386e884ba4ef5113bb52cf0f1ada97c46 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Fri, 16 Dec 2011 14:27:11 -0800 Subject: [PATCH] [1452] use sizeof(uint16_t) instead of a magic number '2' --- src/lib/util/io/socketsession.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/util/io/socketsession.cc b/src/lib/util/io/socketsession.cc index 758a6e7d62..969f8fb943 100644 --- a/src/lib/util/io/socketsession.cc +++ b/src/lib/util/io/socketsession.cc @@ -50,7 +50,7 @@ using namespace internal; // 6 32-bit fields, and 2 sockaddr structure. (see the SocketSessionUtility // overview description in the header file). sizeof sockaddr_storage // should be the possible max of any sockaddr structure -const size_t DEFAULT_HEADER_BUFLEN = 2 + sizeof(uint32_t) * 6 + +const size_t DEFAULT_HEADER_BUFLEN = sizeof(uint16_t) + sizeof(uint32_t) * 6 + sizeof(struct sockaddr_storage) * 2; // The allowable maximum size of data passed with the socket FD. For now