diff --git a/mongoose.h b/mongoose.h
index f15543269869036f63fc9b14a12574f1727c0a96..9ba5afe9f3cdb7eb597e71e591aeb5a9b567094f 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -37,9 +37,9 @@ struct mg_connection {
   const char *query_string;   // URL part after '?', not including '?', or NULL
 
   char remote_ip[48];         // Max IPv6 string length is 45 characters
-  int remote_port;            // Client's port
   const char *local_ip;       // Local IP address
-  int local_port;             // Local port number
+  unsigned short remote_port; // Client's port
+  unsigned short local_port;  // Local port number
 
   int num_headers;            // Number of HTTP headers
   struct mg_header {