Skip to content

Commit 9c5bbdb

Browse files
author
Sebastiano Merlino
committed
Changing requestor_port to be represented with an unsigned short rather than a short
1 parent 8c05ebc commit 9c5bbdb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/http_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ std::string get_ip_str_new(
268268
return to_ret;
269269
}
270270

271-
short get_port(const struct sockaddr* sa)
271+
unsigned short get_port(const struct sockaddr* sa)
272272
{
273273
if(sa)
274274
{

src/httpserver/http_request.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class http_request
358358
* Method used to get the requestor port used.
359359
* @return the requestor port
360360
**/
361-
short get_requestor_port() const
361+
unsigned short get_requestor_port() const
362362
{
363363
return this->requestor_port;
364364
}
@@ -415,7 +415,7 @@ class http_request
415415
std::string version;
416416
std::string requestor;
417417

418-
short requestor_port;
418+
unsigned short requestor_port;
419419
struct MHD_Connection* underlying_connection;
420420

421421
void set_underlying_connection(struct MHD_Connection* conn)
@@ -537,7 +537,7 @@ class http_request
537537
* Method used to set the requestor port
538538
* @param requestor The requestor port to set
539539
**/
540-
void set_requestor_port(short requestor_port)
540+
void set_requestor_port(unsigned short requestor_port)
541541
{
542542
this->requestor_port = requestor_port;
543543
}

src/httpserver/http_utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class http_utils
7979
#if defined(__MINGW32__) || defined(__CYGWIN32__)
8080
INTERNAL_SELECT = MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL,
8181
#else
82-
INTERNAL_SELECT = MHD_USE_SELECT_INTERNALLY | MHD_USE_EPOLL | MHD_USE_EPOLL_TURBO,
82+
INTERNAL_SELECT = MHD_USE_SELECT_INTERNALLY | MHD_USE_EPOLL | MHD_USE_EPOLL_TURBO,
8383
#endif
8484
THREAD_PER_CONNECTION = MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL
8585
};
@@ -331,7 +331,7 @@ std::string get_ip_str_new(const struct sockaddr* sa,
331331
* @param sa The sockaddr object to find the port from
332332
* @return short representing the port
333333
**/
334-
short get_port(const struct sockaddr* sa);
334+
unsigned short get_port(const struct sockaddr* sa);
335335

336336
/**
337337
* Method to output the contents of a headers map to a std::ostream

0 commit comments

Comments
 (0)