Signed-off-by: Andy Green <andy.green@linaro.org>
/* union transition */
memset(&wsi->u, 0, sizeof(wsi->u));
/* union transition */
memset(&wsi->u, 0, sizeof(wsi->u));
wsi->mode = LWS_CONNMODE_HTTP_SERVING_ACCEPTED;
wsi->state = WSI_STATE_HTTP;
wsi->mode = LWS_CONNMODE_HTTP_SERVING_ACCEPTED;
wsi->state = WSI_STATE_HTTP;
+
+ /* expose it at the same offset as u.hdr */
+ wsi->u.http.ah = ah;
+
n = 0;
if (wsi->protocol->callback)
n = wsi->protocol->callback(context, wsi,
n = 0;
if (wsi->protocol->callback)
n = wsi->protocol->callback(context, wsi,
/* now drop the header info we kept a pointer to */
if (ah)
free(ah);
/* now drop the header info we kept a pointer to */
if (ah)
free(ah);
+ /* not possible to continue to use past here */
+ wsi->u.http.ah = NULL;
if (n) {
lwsl_info("LWS_CALLBACK_HTTP closing\n");
if (n) {
lwsl_info("LWS_CALLBACK_HTTP closing\n");
* other APIs to get information out of it.
*/
* other APIs to get information out of it.
*/
-struct _lws_http_mode_related {
- int fd;
- unsigned long filepos;
- unsigned long filelen;
-};
-
struct lws_fragments {
unsigned short offset;
unsigned short len;
struct lws_fragments {
unsigned short offset;
unsigned short len;
+struct _lws_http_mode_related {
+ struct allocated_headers *ah; /* mirroring _lws_header_related */
+ int fd;
+ unsigned long filepos;
+ unsigned long filelen;
+};
+
struct _lws_header_related {
struct allocated_headers *ah;
short lextable_pos;
struct _lws_header_related {
struct allocated_headers *ah;
short lextable_pos;