Skip to content
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
wants to merge 20 commits into from
Closed

CMakeLists.txt: fix build with libev and without testapps #1707

wants to merge 20 commits into from

Conversation

ffontaine
Copy link
Contributor

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

lws-team and others added 20 commits September 22, 2019 09:35
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>
@lws-team
Copy link
Member

lws-team commented Oct 6, 2019

Thanks, I pushed it on v3.2-stable and master.

@lws-team lws-team closed this Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants