[Libwebsockets] lws_rx_flow_control problem

Andy Green andy at warmcat.com
Wed Oct 11 00:35:08 CEST 2017

On 10/11/2017 06:25 AM, Per Bothner wrote:
> On 10/09/2017 07:03 PM, Andy Green wrote:
>>>> In the http2 megapatch rx flow control accepts flags now and you can
>>> individually toggle up to 8 reasons for flow control on the wsi, if any
>>> reason is active it is suppressed.  It's completely
>>> backwards-compatible with just giving it 0 or 1 as before.  How about a
>>> flag you can give in the arg indicating that lws needs to do the
>>> _lws_rx_flow_control() in the call for that one?
>>> That sounds like it would work.
>> It's pushed on master in the h2 patch.  I added docs on 
>> lws_rx_flow_control(), basically OR LWS_RXFLOW_REASON_FLAG_PROCESS_NOW 
>> on the enable arg.
> Thanks!  Is there a way to conditionally compile some code based
> on if this feature is supported?  If LWS_RXFLOW_REASON_FLAG_PROCESS_NOW
> were a macro I could do:
>     ...
> #endif
> but as an enum that doesn't work.
> Is there some other cpp macro I could test?
> (I could write a configure-time test, but that is more complicated.)
I just pushed an updated h2 patch where lws figures out for itself if it 
should do the call.  Basically in lws_rx_flow_control() it sets a bit on 
the wsi saying it will do the call to _lws_rx_flow_control() for that 
wsi, and clears the bit afterwards.  If that bit isn't set on the wsi, 
lws_rx_flow_control() does the call to _lws_rx_flow_control() itself.

That should cover everything without needing to add the flag in user code.


More information about the Libwebsockets mailing list