Rearrange members of struct http_request to reduce padding on amd64
authorFabian Keil <fk@fabiankeil.de>
Thu, 21 Jan 2021 10:28:24 +0000 (11:28 +0100)
committerFabian Keil <fk@fabiankeil.de>
Thu, 21 Jan 2021 12:59:36 +0000 (13:59 +0100)
While at it, change member 'ssl' to short to save memory.

project.h

index 3f6f588..15805e8 100644 (file)
--- a/project.h
+++ b/project.h
@@ -335,11 +335,10 @@ struct http_request
    char *version;  /**< Protocol version */
    int status;     /**< HTTP Status */
 
    char *version;  /**< Protocol version */
    int status;     /**< HTTP Status */
 
-   char *host;     /**< Host part of URL */
    int   port;     /**< Port of URL or 80 (default) */
    int   port;     /**< Port of URL or 80 (default) */
+   char *host;     /**< Host part of URL */
    char *path;     /**< Path of URL */
    char *hostport; /**< host[:port] */
    char *path;     /**< Path of URL */
    char *hostport; /**< host[:port] */
-   int   ssl;      /**< Flag if protocol is https */
 
    char *host_ip_addr_str; /**< String with dotted decimal representation
                                 of host's IP. NULL before connect_to() */
 
    char *host_ip_addr_str; /**< String with dotted decimal representation
                                 of host's IP. NULL before connect_to() */
@@ -354,6 +353,7 @@ struct http_request
    unsigned char hash_of_host_hex[(HASH_OF_HOST_BUF_SIZE * 2) + 1]; /**< chars for hash in hex string and one for '\0'       */
    unsigned char hash_of_host[HASH_OF_HOST_BUF_SIZE+1];             /**< chars for bytes of hash and one for '\0'            */
 #endif
    unsigned char hash_of_host_hex[(HASH_OF_HOST_BUF_SIZE * 2) + 1]; /**< chars for hash in hex string and one for '\0'       */
    unsigned char hash_of_host[HASH_OF_HOST_BUF_SIZE+1];             /**< chars for bytes of hash and one for '\0'            */
 #endif
+   short int   ssl;      /**< Flag if protocol is https */
 };
 
 
 };