MINOR: http: use an enum for the auth method in http_auth_data

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.
This commit is contained in:
Willy Tarreau 2013-12-07 00:18:34 +01:00
parent 3770f23a3a
commit 5735d7e2a2

View File

@ -225,12 +225,12 @@ enum http_meth_t {
HTTP_METH_OTHER, HTTP_METH_OTHER,
} __attribute__((packed)); } __attribute__((packed));
enum { enum ht_auth_m {
HTTP_AUTH_WRONG = -1, /* missing or unknown */ HTTP_AUTH_WRONG = -1, /* missing or unknown */
HTTP_AUTH_UNKNOWN = 0, HTTP_AUTH_UNKNOWN = 0,
HTTP_AUTH_BASIC, HTTP_AUTH_BASIC,
HTTP_AUTH_DIGEST, HTTP_AUTH_DIGEST,
}; } __attribute__((packed));
/* actions for "http-request" */ /* actions for "http-request" */
enum { enum {
@ -354,7 +354,8 @@ struct http_msg {
}; };
struct http_auth_data { struct http_auth_data {
int method; /* one of HTTP_AUTH_* */ 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 */ struct chunk method_data; /* points to the creditial part from 'Authorization:' header */
char *user, *pass; /* extracted username & password */ char *user, *pass; /* extracted username & password */
}; };