NTAP / quant

QUIC implementation for POSIX and IoT platforms
BSD 2-Clause "Simplified" License
289 stars 35 forks source link

q_close_stream not working as intended? #17

Closed futile closed 6 years ago

futile commented 6 years ago

The example server and client work fine for me (branch 14).

However, when I change all q_write*s to q_close_streams in the example server (see send_err and serve_cb here), they start behaving weird.

Ultimately the client runs into a timeout in q_readall_str and closes the connection. However, while the client is "waiting" for the timeout, the server's RTO alarm is firing every 0.010 seconds.

It seems to me that something is going wrong here. My suggestion would be that somehow the server is not sending out a FIN to the client here. Since it works fine when the FIN is sent together with actual data (as is the case in the unmodified example), maybe no FIN is sent when there is no other data to send? Is this actually intended behavior? If so, this behavior would be very non-obvious from looking at the API.

This behavior was detected in the course of the SYMBIOSYS research project at COMSYS, RWTH Aachen University. This research is supported by the European Research Council (ERC) under the EU's Horizon 2020 Research and Innovation Programme grant agreement n. 647295 (SYMBIOSYS).

larseggert commented 6 years ago

The entire "API" is pretty clunky at the moment, and there are definitively bugs. This is likely one of them. When I have some cycles for quant, I'll take a look.

(What quant really needs is a proper test suite, both for the APIP calls and the key internal functions, but there are only so many hours in the day...)

larseggert commented 6 years ago

This particular API issue should hopefully be fixed now, but I'm sure there are others. Please file bugs and/or send PRs as you encounter them.