]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: use an enum for the auth method in http_auth_data
authorWilly Tarreau <w@1wt.eu>
Fri, 6 Dec 2013 23:18:34 +0000 (00:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 15:06:22 +0000 (16:06 +0100)
This method now takes a single byte, with 7 bytes left to be used
after it. No savings were gained but at least now we have an enum.

include/types/proto_http.h

index 70c26310897904d37c4255582dd564c2e87c4bba..9d65d6f3ad2527e378820dea365933a77f576385 100644 (file)
@@ -225,12 +225,12 @@ enum http_meth_t {
        HTTP_METH_OTHER,
 } __attribute__((packed));
 
-enum {
+enum ht_auth_m {
        HTTP_AUTH_WRONG         = -1,           /* missing or unknown */
        HTTP_AUTH_UNKNOWN       = 0,
        HTTP_AUTH_BASIC,
        HTTP_AUTH_DIGEST,
-};
+} __attribute__((packed));
 
 /* actions for "http-request" */
 enum {
@@ -354,9 +354,10 @@ struct http_msg {
 };
 
 struct http_auth_data {
-       int method;                     /* one of HTTP_AUTH_* */
-       struct chunk method_data;       /* points to the creditial part from 'Authorization:' header */
-       char *user, *pass;              /* extracted username & password */
+       enum ht_auth_m method;                /* one of HTTP_AUTH_* */
+       /* 7 bytes unused here */
+       struct chunk method_data;             /* points to the creditial part from 'Authorization:' header */
+       char *user, *pass;                    /* extracted username & password */
 };
 
 struct http_req_rule {