}
#endif
- if (wsi->u.hdr.ah)
- /* we're closing, losing some rx is OK */
- wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen;
+ /* we're closing, losing some rx is OK */
+ lws_header_table_force_to_detachable_state(wsi);
context = wsi->context;
pt = &context->pt[(int)wsi->tsi];
#ifdef LWS_USE_LIBUV
if (LWS_LIBUV_ENABLED(context)) {
+ if (wsi->listener) {
+ lwsl_debug("%s: stopping listner libuv poll\n", __func__);
+ uv_poll_stop(&wsi->w_read.uv_watcher);
+ }
lwsl_debug("%s: lws_libuv_closehandle: wsi %p\n", __func__, wsi);
/* libuv has to do his own close handle processing asynchronously */
lws_libuv_closehandle(wsi);
n = vsnprintf(str, size, format, ap);
va_end(ap);
- if (n >= size)
+ if (n >= (int)size)
return size;
return n;
* Actually having made the env, as a cgi we don't need the ah
* any more
*/
- if (wsi->u.hdr.ah->rxpos == wsi->u.hdr.ah->rxlen)
+ if (lws_header_table_is_in_detachable_state(wsi))
lws_header_table_detach(wsi, 0);
/* we are ready with the redirection pipes... run the thing */
wsi->cgi->l[wsi->cgi->lp] = '\0';
switch (n) {
case SIGNIFICANT_HDR_CONTENT_LENGTH:
- wsi->cgi->content_length = atol(wsi->cgi->l);
+ wsi->cgi->content_length = atoll(wsi->cgi->l);
break;
case SIGNIFICANT_HDR_STATUS:
wsi->cgi->response_code = atol(wsi->cgi->l);
case LCHS_SINGLE_0A:
m = wsi->hdr_state;
if (c == '\x0a') {
- lwsl_debug("Content-Length: %ld\n", wsi->cgi->content_length);
+ lwsl_debug("Content-Length: %lld\n", (unsigned long long)wsi->cgi->content_length);
wsi->hdr_state = LHCS_RESPONSE;
/* drop the \0xa ... finalize will add it if needed */
break;
continue;
if (cgi->content_length) {
- lwsl_debug("%s: wsi %p: expected content length seen: %ld\n",
- __func__, cgi->wsi, cgi->content_length_seen);
+ lwsl_debug("%s: wsi %p: expected content length seen: %lld\n",
+ __func__, cgi->wsi, (unsigned long long)cgi->content_length_seen);
}
/* reap it */
continue;
if (cgi->content_length)
- lwsl_debug("%s: wsi %p: expected content length seen: %ld\n",
- __func__, cgi->wsi, cgi->content_length_seen);
+ lwsl_debug("%s: wsi %p: expected content length seen: %lld\n",
+ __func__, cgi->wsi, (unsigned long long)cgi->content_length_seen);
/* reap it */
if (waitpid(cgi->pid, &status, WNOHANG) > 0) {
#endif
while (v) {
- if (v->use_ssl && v->lserv_wsi) {
+ if (v->lserv_wsi) {
+
struct lws_context_per_thread *pt = &context->pt[(int)v->lserv_wsi->tsi];
struct lws_pollfd *pfd;