From 7f830195d6d6613c52983ccb813edcaf097c12d5 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 9 Mar 2018 08:38:48 +0800 Subject: [PATCH] docs: add note on lws_http_client_http_response about when to call it https://github.com/warmcat/libwebsockets/issues/1202 --- lib/libwebsockets.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index b62660d6..96e1c900 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -3445,6 +3445,10 @@ lws_http_client_read(struct lws *wsi, char **buf, int *len); * \param wsi: client connection * * Returns the last server response code, eg, 200 for client http connections. + * + * You should capture this during the LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP + * callback, because after that the memory reserved for storing the related + * headers is freed and this value is lost. */ LWS_VISIBLE LWS_EXTERN unsigned int lws_http_client_http_response(struct lws *wsi);