Installing recv callback with net_context_recv() after net_context_connect() left an opening for a possible race - in case the server send some data immediately after establishing TCP connection, and Zephyr did not manage to install the callback on time, the data would be lost, corrupting the stream. This can be avoided, by installing the recv callback before the connection is triggered. As net_context_recv() called w/o timeout only registers the callback function, it should have no negative impact. The only change on the TCP side is when the connection is closed - in case TCP is in connect stage, do not call the recv callback (before this change it'd be NULL at that point). Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no> |
||
|---|---|---|
| .. | ||
| conn_mgr | ||
| ip | ||
| l2 | ||
| lib | ||
| pkt_filter | ||
| buf_simple.c | ||
| buf.c | ||
| CMakeLists.txt | ||
| hostname.c | ||
| Kconfig | ||
| Kconfig.hostname | ||
| Kconfig.template.log_config.default.net | ||
| Kconfig.template.log_config.net | ||