• Home
  • Raw
  • Download

Lines Matching full:http

81 	if (!cgi->wsi->http.cgi->post_in_expected)  in lws_cgi_grace()
82 cgi->wsi->http.cgi->cgi_transaction_over = 1; in lws_cgi_grace()
98 if (wsi->http.cgi) in lws_cgi_reap_cb()
100 (int)wsi->http.cgi->post_in_expected); in lws_cgi_reap_cb()
106 if (wsi->http.cgi) in lws_cgi_reap_cb()
107 lws_sul_schedule(wsi->a.context, wsi->tsi, &wsi->http.cgi->sul_grace, in lws_cgi_reap_cb()
127 wsi->http.cgi = lws_zalloc(sizeof(*wsi->http.cgi), "new cgi"); in lws_cgi()
128 if (!wsi->http.cgi) { in lws_cgi()
133 wsi->http.cgi->response_code = HTTP_STATUS_OK; in lws_cgi()
135 cgi = wsi->http.cgi; in lws_cgi()
147 lwsl_wsi_debug(wsi, "adding cgi %p to list", wsi->http.cgi); in lws_cgi()
148 cgi->cgi_list = pt->http.cgi_list; in lws_cgi()
149 pt->http.cgi_list = cgi; in lws_cgi()
163 wsi->http.cgi->gzip_inflate = 1; in lws_cgi()
176 if (wsi->http.ah) { in lws_cgi()
346 if (!wsi->http.cgi->gzip_inflate && in lws_cgi()
356 wsi->http.cgi->post_in_expected = (lws_filepos_t) in lws_cgi()
375 wsi->http.cgi->implied_chunked = 1; in lws_cgi()
376 wsi->http.cgi->explicitly_chunked = 1; in lws_cgi()
404 info.plsp = &wsi->http.cgi->lsp; in lws_cgi()
417 wsi->http.cgi->lsp = lws_spawn_piped(&info); in lws_cgi()
418 if (!wsi->http.cgi->lsp) { in lws_cgi()
436 lws_sul_cancel(&wsi->http.cgi->sul_grace); in lws_cgi()
437 lws_free_set_NULL(wsi->http.cgi); in lws_cgi()
470 if (!wsi->http.cgi) in lws_cgi_write_split_stdout_headers()
481 wsi->http.cgi->response_code); in lws_cgi_write_split_stdout_headers()
483 (unsigned int)wsi->http.cgi->response_code, in lws_cgi_write_split_stdout_headers()
486 if (!wsi->http.cgi->explicitly_chunked && in lws_cgi_write_split_stdout_headers()
487 !wsi->http.cgi->content_length && in lws_cgi_write_split_stdout_headers()
502 * so we have a bunch of http/1 style ascii headers in lws_cgi_write_split_stdout_headers()
503 * starting from wsi->http.cgi->headers_buf through in lws_cgi_write_split_stdout_headers()
504 * wsi->http.cgi->headers_pos. These are OK for http/1 in lws_cgi_write_split_stdout_headers()
505 * connections, but they're no good for http/2 conns. in lws_cgi_write_split_stdout_headers()
508 * correct coding for http/1 or http/2 in lws_cgi_write_split_stdout_headers()
513 p = wsi->http.cgi->headers_start; in lws_cgi_write_split_stdout_headers()
514 wsi->http.cgi->headers_start = in lws_cgi_write_split_stdout_headers()
515 wsi->http.cgi->headers_pos; in lws_cgi_write_split_stdout_headers()
516 wsi->http.cgi->headers_dumped = in lws_cgi_write_split_stdout_headers()
517 wsi->http.cgi->headers_start; in lws_cgi_write_split_stdout_headers()
521 while (p < wsi->http.cgi->headers_start) { in lws_cgi_write_split_stdout_headers()
525 * in http/2 upper-case header names in lws_cgi_write_split_stdout_headers()
563 p + 1 == wsi->http.cgi->headers_start) { in lws_cgi_write_split_stdout_headers()
573 (unsigned char **)&wsi->http.cgi->headers_pos, in lws_cgi_write_split_stdout_headers()
574 (unsigned char *)wsi->http.cgi->headers_end)) in lws_cgi_write_split_stdout_headers()
588 (unsigned char **)&wsi->http.cgi->headers_pos, in lws_cgi_write_split_stdout_headers()
589 (unsigned char *)wsi->http.cgi->headers_end)) { in lws_cgi_write_split_stdout_headers()
603 n = (int)(wsi->http.cgi->headers_pos - in lws_cgi_write_split_stdout_headers()
604 wsi->http.cgi->headers_dumped); in lws_cgi_write_split_stdout_headers()
611 if (wsi->http.cgi->headers_dumped + n != in lws_cgi_write_split_stdout_headers()
612 wsi->http.cgi->headers_pos) { in lws_cgi_write_split_stdout_headers()
618 (unsigned char *)wsi->http.cgi->headers_dumped, in lws_cgi_write_split_stdout_headers()
624 wsi->http.cgi->headers_dumped += n; in lws_cgi_write_split_stdout_headers()
625 if (wsi->http.cgi->headers_dumped == in lws_cgi_write_split_stdout_headers()
626 wsi->http.cgi->headers_pos) { in lws_cgi_write_split_stdout_headers()
628 lws_free_set_NULL(wsi->http.cgi->headers_buf); in lws_cgi_write_split_stdout_headers()
631 if (wsi->http.cgi->post_in_expected) { in lws_cgi_write_split_stdout_headers()
651 if (!wsi->http.cgi->headers_buf) { in lws_cgi_write_split_stdout_headers()
656 wsi->http.cgi->headers_buf = lws_malloc((unsigned int)n + LWS_PRE, in lws_cgi_write_split_stdout_headers()
658 if (!wsi->http.cgi->headers_buf) { in lws_cgi_write_split_stdout_headers()
664 wsi->http.cgi->headers_start = in lws_cgi_write_split_stdout_headers()
665 wsi->http.cgi->headers_buf + LWS_PRE; in lws_cgi_write_split_stdout_headers()
666 wsi->http.cgi->headers_pos = wsi->http.cgi->headers_start; in lws_cgi_write_split_stdout_headers()
667 wsi->http.cgi->headers_dumped = wsi->http.cgi->headers_pos; in lws_cgi_write_split_stdout_headers()
668 wsi->http.cgi->headers_end = in lws_cgi_write_split_stdout_headers()
669 wsi->http.cgi->headers_buf + n - 1; in lws_cgi_write_split_stdout_headers()
672 wsi->http.cgi->match[n] = 0; in lws_cgi_write_split_stdout_headers()
673 wsi->http.cgi->lp = 0; in lws_cgi_write_split_stdout_headers()
677 n = lws_get_socket_fd(wsi->http.cgi->lsp->stdwsi[LWS_STDOUT]); in lws_cgi_write_split_stdout_headers()
689 if (wsi->http.cgi->headers_pos >= in lws_cgi_write_split_stdout_headers()
690 wsi->http.cgi->headers_end - 4) { in lws_cgi_write_split_stdout_headers()
700 wsi->http.cgi->match[1], wsi->hdr_state); in lws_cgi_write_split_stdout_headers()
711 if (!significant_hdr[n][wsi->http.cgi->match[n]] && in lws_cgi_write_split_stdout_headers()
713 wsi->http.cgi->lp < (int)sizeof(wsi->http.cgi->l) - 1) { in lws_cgi_write_split_stdout_headers()
714 wsi->http.cgi->l[wsi->http.cgi->lp++] = c; in lws_cgi_write_split_stdout_headers()
715 wsi->http.cgi->l[wsi->http.cgi->lp] = '\0'; in lws_cgi_write_split_stdout_headers()
718 wsi->http.cgi->content_length = in lws_cgi_write_split_stdout_headers()
719 (lws_filepos_t)atoll(wsi->http.cgi->l); in lws_cgi_write_split_stdout_headers()
722 wsi->http.cgi->response_code = in lws_cgi_write_split_stdout_headers()
723 atoi(wsi->http.cgi->l); in lws_cgi_write_split_stdout_headers()
725 wsi->http.cgi->response_code); in lws_cgi_write_split_stdout_headers()
732 if (significant_hdr[n][wsi->http.cgi->match[n]]) { in lws_cgi_write_split_stdout_headers()
734 significant_hdr[n][wsi->http.cgi->match[n]]) in lws_cgi_write_split_stdout_headers()
735 wsi->http.cgi->match[n]++; in lws_cgi_write_split_stdout_headers()
737 wsi->http.cgi->match[n] = 0; in lws_cgi_write_split_stdout_headers()
744 *wsi->http.cgi->headers_pos++ = '\x0d'; in lws_cgi_write_split_stdout_headers()
746 *wsi->http.cgi->headers_pos++ = (unsigned char)c; in lws_cgi_write_split_stdout_headers()
752 [wsi->http.cgi->match[ in lws_cgi_write_split_stdout_headers()
755 wsi->http.cgi->explicitly_chunked = 1; in lws_cgi_write_split_stdout_headers()
761 wsi->http.cgi->match[SIGNIFICANT_HDR_LOCATION]]) { in lws_cgi_write_split_stdout_headers()
763 wsi->http.cgi->response_code = 302; in lws_cgi_write_split_stdout_headers()
767 *wsi->http.cgi->headers_pos++ = (unsigned char)c; in lws_cgi_write_split_stdout_headers()
785 wsi->http.cgi->match[n] = 0; in lws_cgi_write_split_stdout_headers()
786 wsi->http.cgi->lp = 0; in lws_cgi_write_split_stdout_headers()
795 wsi->http.cgi->content_length); in lws_cgi_write_split_stdout_headers()
799 * will add it if needed (HTTP/1) in lws_cgi_write_split_stdout_headers()
807 *wsi->http.cgi->headers_pos++ = (unsigned char)c; in lws_cgi_write_split_stdout_headers()
810 wsi->http.cgi->match[n] = 0; in lws_cgi_write_split_stdout_headers()
811 wsi->http.cgi->lp = 0; in lws_cgi_write_split_stdout_headers()
825 m = !wsi->http.cgi->implied_chunked && !wsi->mux_substream && in lws_cgi_write_split_stdout_headers()
826 // !wsi->http.cgi->explicitly_chunked && in lws_cgi_write_split_stdout_headers()
827 !wsi->http.cgi->content_length; in lws_cgi_write_split_stdout_headers()
828 n = lws_get_socket_fd(wsi->http.cgi->lsp->stdwsi[LWS_STDOUT]); in lws_cgi_write_split_stdout_headers()
865 if (wsi->http.cgi->content_length_seen + (unsigned int)n == in lws_cgi_write_split_stdout_headers()
866 wsi->http.cgi->content_length) in lws_cgi_write_split_stdout_headers()
875 wsi->http.cgi->content_length_seen += (unsigned int)n; in lws_cgi_write_split_stdout_headers()
888 wsi->http.cgi->cgi_transaction_over = 1; in lws_cgi_write_split_stdout_headers()
914 if (!wsi->http.cgi || !wsi->http.cgi->lsp) in lws_cgi_kill()
917 pid = wsi->http.cgi->lsp->child_pid; in lws_cgi_kill()
919 args.stdwsi = &wsi->http.cgi->lsp->stdwsi[0]; in lws_cgi_kill()
920 lws_spawn_piped_kill_child_process(wsi->http.cgi->lsp); in lws_cgi_kill()
921 /* that has invalidated and NULL'd wsi->http.cgi->lsp */ in lws_cgi_kill()
924 if (wsi->http.cgi) in lws_cgi_kill()
925 m = wsi->http.cgi->being_closed; in lws_cgi_kill()
950 pcgi = &pt->http.cgi_list; in lws_cgi_kill_terminated()
1008 pcgi = &pt->http.cgi_list; in lws_cgi_kill_terminated()
1069 if (!wsi->http.cgi) in lws_cgi_get_stdwsi()
1072 return wsi->http.cgi->lsp->stdwsi[ch]; in lws_cgi_get_stdwsi()
1079 struct lws_cgi **pcgi = &pt->http.cgi_list; in lws_cgi_remove_and_kill()
1084 if (*pcgi == wsi->http.cgi) { in lws_cgi_remove_and_kill()
1091 if (wsi->http.cgi->headers_buf) in lws_cgi_remove_and_kill()
1092 lws_free_set_NULL(wsi->http.cgi->headers_buf); in lws_cgi_remove_and_kill()
1095 wsi->http.cgi->being_closed = 1; in lws_cgi_remove_and_kill()
1098 if (!pt->http.cgi_list) in lws_cgi_remove_and_kill()