Closed AnthonyGrondin closed 1 month ago
I'll write this here to document the behavior, but there is currently an issue with how esp-wifi
, esp-mbedtls
, edge-net
act together.
Specifically, if a client sends a request with the header "Connection": "Close"
, the server implementation of edge-net
requests a read()
from esp-mbedtls
(It won't if the body type is something else). Since the client has sent all its data, async_internal_read()
will hang on reading data from socket. This is due to esp-wifi
's read impl that blocks on read until there is data.
I'll write this here to document the behavior, but there is currently an issue with how
esp-wifi
,esp-mbedtls
,edge-net
act together.Specifically, if a client sends a request with the header
"Connection": "Close"
, the server implementation ofedge-net
requests aread()
fromesp-mbedtls
(It won't if the body type is something else). Since the client has sent all its data,async_internal_read()
will hang on reading data from socket. This is due toesp-wifi
's read impl that blocks on read until there is data.
I'm not sure I follow 100% but regardless, are you using the master
version of edge-http
?
There is a fix in master
I did recently which avoids a similar (yet, the opposite) problem, where if there are multiple requests scheduled over a single TCP connection, the processing of the first request might read a bit into the second request.
This PR provides an implementation of edge_nal::TcpAccept to use
esp-mbedtls
withedge-net
.As for now, the trait is simply a wrapper over the edge_nal::TcpAccept implementation from
edge-nal-embassy
.I also provided an example that uses
edge-http
in server mode for testing, and ensuring compatibility.Further down the line, other traits will also get their implementation, in subsequent PRs, as I (or any contributor) come around a use case for them.