[Libwebsockets] LWS_WITH_HTTP_UNCOMMON_HEADERS compile problem
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:
> In function 'lws_unauthorised_basic_auth':
> 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
> 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
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.
More information about the Libwebsockets