LWS_CALLBACK_FILTER_HTTP_CONNECTION,
wsi->user_space, uri_ptr, uri_len);
- if (!n && wsi->protocol->callback)
- n = wsi->protocol->callback(context, wsi,
- LWS_CALLBACK_HTTP,
- wsi->user_space, uri_ptr, uri_len);
+ if (!n) {
+ /*
+ * if there is content supposed to be coming,
+ * put a timeout on it having arrived
+ */
+ libwebsocket_set_timeout(wsi,
+ PENDING_TIMEOUT_HTTP_CONTENT,
+ AWAITING_TIMEOUT);
+
+ if (wsi->protocol->callback)
+ n = wsi->protocol->callback(context, wsi,
+ LWS_CALLBACK_HTTP,
+ wsi->user_space, uri_ptr, uri_len);
+ }
leave:
/* now drop the header info we kept a pointer to */
}
/*
- * if there is content supposed to be coming,
- * put a timeout on it having arrived
- */
- libwebsocket_set_timeout(wsi,
- PENDING_TIMEOUT_HTTP_CONTENT,
- AWAITING_TIMEOUT);
-
- /*
* (if callback didn't start sending a file)
* deal with anything else as body, whether
* there was a content-length or not