cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
https_upgrade_hook.c
Go to the documentation of this file.
1
/* Default no-op implementation of the optional HTTPS upgrade hook.
2
*
3
* Applications that need to take ownership of a TLS-upgraded connection
4
* (e.g. reverse-session hijacking) provide their own strong definition of
5
* cwist_https_upgrade_handler(). This stub lives in its own translation
6
* unit so the static linker only extracts it from libcwist.a when the
7
* application does not define the symbol; the weak attribute additionally
8
* keeps --whole-archive style links from failing with a duplicate
9
* definition (both ELF and Mach-O support weak definitions). This is more
10
* portable than a weak *declaration*: Mach-O has no ELF-style weak
11
* undefined symbols, and weak_import did not satisfy the Darwin linker.
12
*
13
* Return true to detach the fd/ssl from cwist so they are not closed after
14
* the response is sent. The default returns false (keep cwist ownership).
15
*/
16
#include <
cwist/net/http/https.h
>
17
32
__attribute__
((
weak
))
bool
cwist_https_upgrade_handler
(
cwist_https_connection
*conn,
33
cwist_http_request
*req,
34
cwist_http_response
*res) {
35
(
void
)conn;
36
(
void
)req;
37
(
void
)res;
38
return
false
;
39
}
cwist_https_upgrade_handler
bool cwist_https_upgrade_handler(cwist_https_connection *conn, cwist_http_request *req, cwist_http_response *res)
__attribute__
__attribute__((weak))
Optional hook called after a successful TLS upgrade of a connection.
Definition
https_upgrade_hook.c:32
https.h
HTTPS/TLS wrapper interface.
cap
size_t cap
Definition
otel.c:56
cwist_http_request
Definition
http.h:65
cwist_http_response
HTTP Response Object. Supports standard string body or Zero-Copy pointer body.
Definition
http.h:82
cwist_https_connection
Definition
https.h:21
src
net
http
https_upgrade_hook.c
Generated by
1.9.8