From: JINMEI Tatuya Date: Fri, 16 Dec 2011 22:27:11 +0000 (-0800) Subject: [1452] use sizeof(uint16_t) instead of a magic number '2' X-Git-Tag: perftcpdns_before_epoll~5^2~6^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b4c9db386e884ba4ef5113bb52cf0f1ada97c46;p=thirdparty%2Fkea.git [1452] use sizeof(uint16_t) instead of a magic number '2' --- 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