[Libwebsockets] LWS_WITH_HTTP_UNCOMMON_HEADERS compile problem
Andy Green
andy at warmcat.com
Fri May 1 16:00:00 CEST 2020
On 5/1/20 2:54 PM, Jakov Smolic wrote:
> Hi Andy,
> building libwebsockets on Gentoo Linux uncommon header support turned
> off causes some build problems.
> Namely, I get this error:
>
> /var/tmp/portage/net-libs/libwebsockets-4.0.4/work/libwebsockets-4.0.4/lib/roles/http/server/server.c:
> In function 'lws_unauthorised_basic_auth':
> /var/tmp/portage/net-libs/libwebsockets-4.0.4/work/libwebsockets-4.0.4/lib/roles/http/server/server.c:873:4:
> error: 'WSI_TOKEN_HTTP_WWW_AUTHENTICATE' undeclared (first use in this
> function); did you mean 'WSI_TOKEN_HTTP_CONTENT_RANGE'?
> 873 | WSI_TOKEN_HTTP_WWW_AUTHENTICATE,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | WSI_TOKEN_HTTP_CONTENT_RANGE
> /var/tmp/portage/net-libs/libwebsockets-4.0.4/work/libwebsockets-4.0.4/lib/roles/http/server/server.c:873:4:
> note: each undeclared identifier is reported only once for each function
> it appears in
>
> I'm not sure if this is related with my build configuration or something
> else.
I think it just means if you want LWS_WITH_HTTP_BASIC_AUTH, it needs the
uncommon headers then, since WWW_AUTHENTICATE is counted among them.
The idea of splitting the headers was to make sure really small
implementations don't get burdened with dealing with headers related to
h2 / ws / funny headers they're not using (the heap usage / size of the
ah is related to this as well).
You can either turn LWS_WITH_HTTP_BASIC_AUTH off or enable uncommon
headers I guess. It probably makes sense for BASIC_AUTH to enable
uncommon headers in the CMakeLists.txt if that's all it is.
-Andy
More information about the Libwebsockets
mailing list