break;
#endif
+ case LWSS_HTTP_ISSUING_FILE:
+ return 0;
+
case LWSS_CLIENT_HTTP_ESTABLISHED:
break;
case LWSS_HTTP:
wsi->hdr_parsing_completed = 0;
/* fallthru */
- case LWSS_HTTP_ISSUING_FILE:
- wsi->state = LWSS_HTTP_HEADERS;
- wsi->u.hdr.parser_state = WSI_TOKEN_NAME_PART;
- wsi->u.hdr.lextable_pos = 0;
- /* fallthru */
+
case LWSS_HTTP_HEADERS:
if (!wsi->u.hdr.ah) {
lwsl_err("%s: LWSS_HTTP_HEADERS: NULL ah\n", __func__);
_lws_header_table_reset(ah);
+ wsi->u.hdr.parser_state = WSI_TOKEN_NAME_PART;
+ wsi->u.hdr.lextable_pos = 0;
+
/* since we will restart the ah, our new headers are not completed */
// wsi->hdr_parsing_completed = 0;
}
/* just ignore incoming if waiting for close */
- if (wsi->state != LWSS_FLUSHING_STORED_SEND_BEFORE_CLOSE) {
+ if (wsi->state != LWSS_FLUSHING_STORED_SEND_BEFORE_CLOSE &&
+ wsi->state != LWSS_HTTP_ISSUING_FILE) {
n = lws_read(wsi, ah->rx + ah->rxpos,
ah->rxlen - ah->rxpos);
if (n < 0) /* we closed wsi */
}
/* just ignore incoming if waiting for close */
- if (wsi->state != LWSS_FLUSHING_STORED_SEND_BEFORE_CLOSE) {
+ if (wsi->state != LWSS_FLUSHING_STORED_SEND_BEFORE_CLOSE &&
+ wsi->state != LWSS_HTTP_ISSUING_FILE) {
/*
* this may want to send
* (via HTTP callback for example)