diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-07-30 22:28:25 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-08-09 21:24:54 +0300 |
commit | 6bf4168dfef7a679d4ef11c9e8a6c170ce050db1 (patch) | |
tree | 2391c34a24215b5efc8a76d43f6af9a7579d5f0a /src/microhttpd/internal.h | |
parent | 82d864759c08796d36139336df070b62b1a0e077 (diff) | |
download | libmicrohttpd-6bf4168dfef7a679d4ef11c9e8a6c170ce050db1.tar.gz libmicrohttpd-6bf4168dfef7a679d4ef11c9e8a6c170ce050db1.zip |
gen_auth: added support for two authorization headers in request
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r-- | src/microhttpd/internal.h | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index d892c1e4..e9ffb28a 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -62,6 +62,10 @@ | |||
62 | #include "mhd_locks.h" | 62 | #include "mhd_locks.h" |
63 | #include "mhd_sockets.h" | 63 | #include "mhd_sockets.h" |
64 | #include "mhd_itc_types.h" | 64 | #include "mhd_itc_types.h" |
65 | #if defined(BAUTH_SUPPORT) || defined(DAUTH_SUPPORT) | ||
66 | #include "gen_auth.h" | ||
67 | #endif /* BAUTH_SUPPORT || DAUTH_SUPPORT*/ | ||
68 | |||
65 | 69 | ||
66 | /** | 70 | /** |
67 | * Macro to drop 'const' qualifier from pointer without compiler warning. | 71 | * Macro to drop 'const' qualifier from pointer without compiler warning. |
@@ -786,8 +790,6 @@ typedef ssize_t | |||
786 | size_t max_bytes); | 790 | size_t max_bytes); |
787 | 791 | ||
788 | 792 | ||
789 | struct MHD_AuthRqHeader; /* Forward declaration only */ | ||
790 | |||
791 | /** | 793 | /** |
792 | * Ability to use same connection for next request | 794 | * Ability to use same connection for next request |
793 | */ | 795 | */ |
@@ -1020,6 +1022,33 @@ struct MHD_Request | |||
1020 | */ | 1022 | */ |
1021 | bool client_aware; | 1023 | bool client_aware; |
1022 | 1024 | ||
1025 | #ifdef BAUTH_SUPPORT | ||
1026 | /** | ||
1027 | * Basic Authorization parameters. | ||
1028 | * The result of Basic Authorization header parsing. | ||
1029 | * Allocated in the connection's pool. | ||
1030 | */ | ||
1031 | const struct MHD_RqBAuth *bauth; | ||
1032 | |||
1033 | /** | ||
1034 | * Set to true if current request headers are checked for Basic Authorization | ||
1035 | */ | ||
1036 | bool bauth_tried; | ||
1037 | #endif /* BAUTH_SUPPORT */ | ||
1038 | #ifdef DAUTH_SUPPORT | ||
1039 | /** | ||
1040 | * Digest Authorization parameters. | ||
1041 | * The result of Digest Authorization header parsing. | ||
1042 | * Allocated in the connection's pool. | ||
1043 | */ | ||
1044 | const struct MHD_RqDAuth *dauth; | ||
1045 | |||
1046 | /** | ||
1047 | * Set to true if current request headers are checked for Digest Authorization | ||
1048 | */ | ||
1049 | bool dauth_tried; | ||
1050 | #endif /* DAUTH_SUPPORT */ | ||
1051 | |||
1023 | /** | 1052 | /** |
1024 | * Last incomplete header line during parsing of headers. | 1053 | * Last incomplete header line during parsing of headers. |
1025 | * Allocated in pool. Only valid if state is | 1054 | * Allocated in pool. Only valid if state is |
@@ -1183,14 +1212,6 @@ struct MHD_Connection | |||
1183 | */ | 1212 | */ |
1184 | void *socket_context; | 1213 | void *socket_context; |
1185 | 1214 | ||
1186 | #if defined(BAUTH_SUPPORT) || defined(DAUTH_SUPPORT) | ||
1187 | /** | ||
1188 | * Pointer to request authorization structure. | ||
1189 | * Allocated in pool. | ||
1190 | */ | ||
1191 | const struct MHD_AuthRqHeader *rq_auth; | ||
1192 | #endif | ||
1193 | |||
1194 | /** | 1215 | /** |
1195 | * Close connection after sending response? | 1216 | * Close connection after sending response? |
1196 | * Functions may change value from "Unknown" or "KeepAlive" to "Must close", | 1217 | * Functions may change value from "Unknown" or "KeepAlive" to "Must close", |