-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re-entrancy of httpd_ws_recv_frame (IDFGH-4619) #6433
Comments
0001-esp_http_server-support-dynamic-payload-len-for-ws-s.zip |
Hi @yuanjianmin |
Hi @yuanjianmin, thanks for writing that patch! I have just reviewed it and agree with NikLeberg that it is quite useful. Hoping that Espressif will be able to accept the changes so that I can rely on them in my application. |
@NikLeberg @oclyke hi guys, the patch has been merged and will be synchronized to Github later. I will notify you as soon as synchronized to github. Thanks. |
Thanks for the addition of websocket support in the IDF! Overall it is making my job far easier. The problem I am facing is that I am forced to use a local buffer with a fixed size to receive the packet payload.
I would like to use
httpd_ws_recv_frame
(or another high level idf function) to measure the message length of the websocket packet before allocating memory to use for the payload, thus allowing me to handle any size packet. For example:However from experience I have deduced that one cannot call
httpd_ws_recv_frame
more than once for a particular httpd request. When I do I always get the errorESP_ERR_INVALID_SIZE
("WS Message too long")An example of a similar api is that of
snprintf
which, when the output buffer isNULL
will return the number of characters that would have been necessary to store the output.(p.s. if there is an existing API to get this information I would be happy to hear about it. I have tried searching the IDF docs but info concerning the
httpd_ws_recv_frame
function seems sparse)The text was updated successfully, but these errors were encountered: