mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00

This changes the approach of tx credit management to set the initial stream tx credit window to zero. This is the only way with RFC7540 to gain the ability to selectively precisely rx flow control incoming streams. At the time the headers are sent, a WINDOW_UPDATE is sent with the initial tx credit towards us for that specific stream. By default, this acts as before with a 256KB window added for both the stream and the nwsi, and additional window management sent as stuff is received. It's now also possible to set a member in the client info struct and a new option LCCSCF_H2_MANUAL_RXFLOW to precisely manage both the initial tx credit for a specific stream and the ongoing rate limit by meting out further tx credit manually. Add another minimal example http-client-h2-rxflow demonstrating how to force a connection's peer's initial budget to transmit to us and control it during the connection lifetime to restrict the amount of incoming data we have to buffer.
33 lines
831 B
Bash
Executable file
33 lines
831 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# $1: path to minimal example binaries...
|
|
# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES=1
|
|
# that will be ./bin from your build dir
|
|
#
|
|
# $2: path for logs and results. The results will go
|
|
# in a subdir named after the directory this script
|
|
# is in
|
|
#
|
|
# $3: offset for test index count
|
|
#
|
|
# $4: total test count
|
|
#
|
|
# $5: path to ./minimal-examples dir in lws
|
|
#
|
|
# Test return code 0: OK, 254: timed out, other: error indication
|
|
|
|
. $5/selftests-library.sh
|
|
|
|
COUNT_TESTS=4
|
|
|
|
dotest $1 $2 warmcat
|
|
dotest $1 $2 warmcat-h1 --h1
|
|
|
|
spawn "" $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls
|
|
dotest $1 $2 localhost -l
|
|
spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls
|
|
dotest $1 $2 localhost-h1 -l --h1
|
|
|
|
kill $SPID 2>/dev/null
|
|
wait $SPID 2>/dev/null
|
|
exit $FAILS
|