mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
add context construction option to skip server hostname lookup
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
15e31f373d
commit
788c4a8fa8
3 changed files with 36 additions and 24 deletions
|
@ -2596,6 +2596,13 @@ libwebsocket_create_context(int port, const char *interf,
|
||||||
context->ssl_client_ctx = NULL;
|
context->ssl_client_ctx = NULL;
|
||||||
openssl_websocket_private_data_index = 0;
|
openssl_websocket_private_data_index = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (options & LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME) {
|
||||||
|
|
||||||
|
strcpy(context->canonical_hostname, "unknown");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
/* find canonical hostname */
|
/* find canonical hostname */
|
||||||
|
|
||||||
hostname[(sizeof hostname) - 1] = '\0';
|
hostname[(sizeof hostname) - 1] = '\0';
|
||||||
|
@ -2624,6 +2631,7 @@ libwebsocket_create_context(int port, const char *interf,
|
||||||
|
|
||||||
// fprintf(stderr, "context->canonical_hostname = %s\n",
|
// fprintf(stderr, "context->canonical_hostname = %s\n",
|
||||||
// context->canonical_hostname);
|
// context->canonical_hostname);
|
||||||
|
}
|
||||||
|
|
||||||
/* split the proxy ads:port if given */
|
/* split the proxy ads:port if given */
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ typedef int ssize_t;
|
||||||
enum libwebsocket_context_options {
|
enum libwebsocket_context_options {
|
||||||
LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK = 1,
|
LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK = 1,
|
||||||
LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,
|
LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,
|
||||||
|
LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum libwebsocket_callback_reasons {
|
enum libwebsocket_callback_reasons {
|
||||||
|
|
|
@ -258,6 +258,9 @@ else ignored
|
||||||
<dd>user id to change to after setting listen socket, or -1.
|
<dd>user id to change to after setting listen socket, or -1.
|
||||||
<dt><b>options</b>
|
<dt><b>options</b>
|
||||||
<dd>0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK
|
<dd>0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK
|
||||||
|
<dt><b>user</b>
|
||||||
|
<dd>optional user pointer that can be recovered via the context
|
||||||
|
pointer using libwebsocket_context_user
|
||||||
</dl>
|
</dl>
|
||||||
<h3>Description</h3>
|
<h3>Description</h3>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
|
Loading…
Add table
Reference in a new issue