Use of buffers in the stack with espconn_sent
Posted: Mon Jul 20, 2015 11:40 am
The SDK documentation clearly states that espconn_sent() cannot be called again until the espconn_sent_cb() callback is received.
I'm guessing that this also means that the data buffer passed to espconn_sent() cannot also be used until after the callback is received. This makes sense from the SDK implementor's point of view, since they wouldn't have to make another copy of the data.
However, I notice that esphttpd is placing buffers on the stack and then passing those to espconn_sent() in at least two places. If my supposition is true (and once again this is only a guess), this might be an issue.
Has this possibility been considered before? Has anyone from EspressIf explicitly confirmed that the data pointer can be reused on return?
I'm guessing that this also means that the data buffer passed to espconn_sent() cannot also be used until after the callback is received. This makes sense from the SDK implementor's point of view, since they wouldn't have to make another copy of the data.
However, I notice that esphttpd is placing buffers on the stack and then passing those to espconn_sent() in at least two places. If my supposition is true (and once again this is only a guess), this might be an issue.
Has this possibility been considered before? Has anyone from EspressIf explicitly confirmed that the data pointer can be reused on return?