hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 265 forks source link

Default server configuration prevents the use of server pushes #755

Open thalesfragoso opened 4 months ago

thalesfragoso commented 4 months ago

https://github.com/hyperium/h2/blob/a8af2358647cd2a68f851dfe3228cc3116654223/src/server.rs#L1378-L1379

This is arguably a bad default, given that it will block any server pushes unless the client explicitly sends a non-zero MAX_CONCURRENT_STREAMS setting.

I don't think we should limit the server that way unless the client explicitly requests that.

seanmonstar commented 4 months ago

Interesting find. I see how that'd be a problem, yea. A PR to change that is welcome.

thalesfragoso commented 4 months ago

Interesting find.

There was some head scratching involved when I couldn't get server push working between a h2 client and server. The workaround is to have the client always send a MAX_CONCURRENT_STREAMS setting, obliviously.

A PR to change that is welcome.

Will do soon. Any opinions on a default value ? I will also add a method to the server Builder, like the one that already exists in the client's.

seanmonstar commented 4 months ago

Unless there's prior art we can copy, an educated guess makes sense.