New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMakeLists.txt: fix build with libev and without testapps #1707
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduce a generic lws_state object with notification handlers that may be registered in a chain. Implement one of those in the context to manage the "system state". Allow other pieces of lws and user code to register notification handlers on a context list. Handlers can object to or take over responsibility to move forward and retry system state changes if they know that some dependent action must succeed first. For example if the system time is invalid, we cannot move on to a state where anything can do tls until that has been corrected.
Rather than do all switches by hand on the minimal examples, add a helper that knows some "builtin" ones like -d and others to set context options you might want to use in any example.
lws_now_usecs() uses monotonic time now. It's not sync'd with wallclock time and the two can't be mixed. Switch to gettimeofday which is nonmonotonic and use also for fractional time to avoid fractional secs in logs being unrelated to integer seconds boundary.
h1 and h2 has a bunch of code supporting autobinding outgoing client connections to be streams in, or queued as pipelined on, the same / existing single network connection, if it's to the same endpoint. Adapt this http-specific code and active connection tracking to be usable for generic muxable protocols the same way.
This shouldn't be necessary; just END_HEADERS flag should be enough. But nghttp2 will not talk to us unless we end the stream from our side. Unfortunately ending the stream at the time we sent the headers means we cannot support the long poll half-close scheme. So add a quirk flag to optionally support this behaviour of nghttp2 when the client is creating the connection.
Some servers set the tx credit to the absolute max and then add to it... this is illegal (and checked for in h2spec). Add a quirk flag that works around it by reducing the initial tx credit size by a factor of 16.
This affects max header size since we use the latter half of the pt_serv_buf to prepare the (possibly huge) auth token. Adapt the pt_serv_buf_size in the hugeurl example.
Move libev workaround outside the if ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS) block otherwise build fails on: /home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c: In function 'lws_ev_hrtimer_cb': /home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c:34:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] ev_timer_set(&pt->ev.hrtimer, ((float)us) / 1000000.0, 0); ^~~~~~~~~~~~ Fixes: - http://autobuild.buildroot.org/results/b5a2188dce90f3ca9bf0cc7a043c1a946b8e288f Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Thanks, I pushed it on v3.2-stable and master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move libev workaround outside the
if ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS) block
otherwise build fails on:
/home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c: In function 'lws_ev_hrtimer_cb':
/home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c:34:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
ev_timer_set(&pt->ev.hrtimer, ((float)us) / 1000000.0, 0);
^~~~~~~~~~~~
Fixes:
Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com