mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
h2: cmake: build with NO_SERVER
This commit is contained in:
parent
a8eebc47a5
commit
d339505f51
3 changed files with 8 additions and 12 deletions
|
@ -383,12 +383,6 @@ if(GIT_EXECUTABLE)
|
|||
message("Git commit hash: ${LWS_BUILD_HASH}")
|
||||
endif()
|
||||
|
||||
# translate old functionality enables to set up ROLE enables so nothing changes
|
||||
if (LWS_WITH_HTTP2 AND LWS_WITHOUT_SERVER)
|
||||
set(LWS_WITH_HTTP2 0)
|
||||
message("HTTP2 disabled due to LWS_WITHOUT_SERVER")
|
||||
endif()
|
||||
|
||||
if (LWS_WITH_HTTP2)
|
||||
set(LWS_ROLE_H2 1)
|
||||
endif()
|
||||
|
@ -791,10 +785,6 @@ if (LWS_UNIX_SOCK)
|
|||
set(LWS_WITH_UNIX_SOCK 1)
|
||||
endif()
|
||||
|
||||
if (LWS_WITH_HTTP2)
|
||||
set(LWS_WITH_HTTP2 1)
|
||||
endif()
|
||||
|
||||
if ("${LWS_MAX_SMP}" STREQUAL "")
|
||||
set(LWS_MAX_SMP 1)
|
||||
endif()
|
||||
|
@ -1514,7 +1504,7 @@ if (NOT LWS_WITHOUT_BUILTIN_SHA1)
|
|||
lib/misc/sha-1.c)
|
||||
endif()
|
||||
|
||||
if (LWS_WITH_HTTP2 AND NOT LWS_WITHOUT_SERVER)
|
||||
if (LWS_WITH_HTTP2)
|
||||
list(APPEND SOURCES
|
||||
lib/roles/h2/http2.c
|
||||
lib/roles/h2/hpack.c
|
||||
|
|
|
@ -2466,7 +2466,7 @@ fail_length:
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(LWS_ROLE_WS)
|
||||
#if defined(LWS_ROLE_WS) && defined(LWS_WITH_SERVER)
|
||||
int
|
||||
lws_h2_ws_handshake(struct lws *wsi)
|
||||
{
|
||||
|
|
|
@ -488,6 +488,7 @@ rops_write_role_protocol_h2(struct lws *wsi, unsigned char *buf, size_t len,
|
|||
return (int)olen;
|
||||
}
|
||||
|
||||
#if defined(LWS_WITH_SERVER)
|
||||
static int
|
||||
rops_check_upgrades_h2(struct lws *wsi)
|
||||
{
|
||||
|
@ -526,6 +527,7 @@ rops_check_upgrades_h2(struct lws *wsi)
|
|||
return LWS_UPG_RET_CONTINUE;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
rops_init_vhost_h2(struct lws_vhost *vh,
|
||||
|
@ -1225,7 +1227,11 @@ rops_issue_keepalive_h2(struct lws *wsi, int isvalid)
|
|||
const struct lws_role_ops role_ops_h2 = {
|
||||
/* role name */ "h2",
|
||||
/* alpn id */ "h2",
|
||||
#if defined(LWS_WITH_SERVER)
|
||||
/* check_upgrades */ rops_check_upgrades_h2,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
/* pt_init_destroy */ rops_pt_init_destroy_h2,
|
||||
/* init_vhost */ rops_init_vhost_h2,
|
||||
/* destroy_vhost */ NULL,
|
||||
|
|
Loading…
Add table
Reference in a new issue