Skip to content

Commit e792f12

Browse files
author
Sebastiano Merlino
committed
Parametrized mask value
1 parent a6e2ecb commit e792f12

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/HttpUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ ip_representation::ip_representation(const struct sockaddr* ip)
293293
pieces[i/2] = ((u_char*)&(((struct sockaddr_in6 *)ip)->sin6_addr))[i] + 16 * ((u_char*)&(((struct sockaddr_in6 *)ip)->sin6_addr))[i+1];
294294
}
295295
}
296-
mask = 65535;
296+
mask = DEFAULT_MASK_VALUE;
297297
}
298298

299299
ip_representation::ip_representation(const std::string& ip)
300300
{
301301
std::vector<std::string> parts;
302-
mask = 65535;
302+
mask = DEFAULT_MASK_VALUE;
303303
std::fill(pieces, pieces + 16, 0);
304304
if(ip.find(':') != std::string::npos) //IPV6
305305
{

src/httpserver/HttpUtils.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <gnutls/gnutls.h>
3232
#endif
3333

34+
#define DEFAULT_MASK_VALUE 65535
35+
3436
namespace httpserver {
3537
namespace http {
3638

@@ -275,7 +277,7 @@ struct ip_representation
275277

276278
ip_representation(HttpUtils::IPVersion_T ip_version) : ip_version(ip_version)
277279
{
278-
mask = 65535;
280+
mask = DEFAULT_MASK_VALUE;
279281
std::fill(pieces, pieces + 16, 0);
280282
}
281283

0 commit comments

Comments
 (0)