Lines Matching refs:swsi
764 h2n->swsi = lws_wsi_server_new(wsi->vhost, wsi, 1); in lws_h2_do_pps_send()
765 if (!h2n->swsi) in lws_h2_do_pps_send()
769 h2n->swsi->http.ah = wsi->http.ah; in lws_h2_do_pps_send()
773 h2n->swsi->http.ah); in lws_h2_do_pps_send()
774 h2n->swsi->txc.tx_cr = in lws_h2_do_pps_send()
777 h2n->swsi, (int)h2n->swsi->txc.tx_cr); in lws_h2_do_pps_send()
778 h2n->swsi->h2.initialized = 1; in lws_h2_do_pps_send()
780 h2n->swsi->h2.END_STREAM = 1; in lws_h2_do_pps_send()
787 if (lws_http_action(h2n->swsi)) in lws_h2_do_pps_send()
911 h2n->swsi = wsi; in lws_h2_parse_frame_header()
929 h2n->swsi = lws_wsi_mux_from_id(wsi, h2n->sid); in lws_h2_parse_frame_header()
932 wsi, h2n->swsi, h2n->type, h2n->flags, (unsigned int)h2n->sid, in lws_h2_parse_frame_header()
953 if (h2n->swsi) in lws_h2_parse_frame_header()
955 __func__, h2n->swsi, in lws_h2_parse_frame_header()
956 h2_state_names[h2n->swsi->h2.h2_state], h2n->type); in lws_h2_parse_frame_header()
981 __func__, h2n->swsi, (unsigned int)h2n->sid, h2n->type); in lws_h2_parse_frame_header()
988 if (h2n->swsi && h2n->sid && in lws_h2_parse_frame_header()
989 !(http2_rx_validity[h2n->swsi->h2.h2_state] & (1 << h2n->type))) { in lws_h2_parse_frame_header()
991 __func__, h2n->swsi, in lws_h2_parse_frame_header()
992 h2_state_names[h2n->swsi->h2.h2_state], h2n->type, in lws_h2_parse_frame_header()
993 http2_rx_validity[h2n->swsi->h2.h2_state]); in lws_h2_parse_frame_header()
995 if (h2n->swsi->h2.h2_state == LWS_H2_STATE_CLOSED || in lws_h2_parse_frame_header()
996 h2n->swsi->h2.h2_state == LWS_H2_STATE_HALF_CLOSED_REMOTE) in lws_h2_parse_frame_header()
1032 if (!h2n->swsi) { in lws_h2_parse_frame_header()
1037 lwsl_info("DATA rx on state %d\n", h2n->swsi->h2.h2_state); in lws_h2_parse_frame_header()
1040 h2n->swsi->h2.h2_state == LWS_H2_STATE_HALF_CLOSED_REMOTE || in lws_h2_parse_frame_header()
1041 h2n->swsi->h2.h2_state == LWS_H2_STATE_CLOSED) { in lws_h2_parse_frame_header()
1076 if (!h2n->swsi) { in lws_h2_parse_frame_header()
1088 lws_h2_state(h2n->swsi, LWS_H2_STATE_CLOSED); in lws_h2_parse_frame_header()
1154 !h2n->swsi) { in lws_h2_parse_frame_header()
1160 if (h2n->swsi->h2.END_HEADERS) { in lws_h2_parse_frame_header()
1176 if (h2n->swsi && !h2n->swsi->h2.END_STREAM && in lws_h2_parse_frame_header()
1177 h2n->swsi->h2.END_HEADERS && in lws_h2_parse_frame_header()
1187 h2n->swsi = lws_wsi_mux_from_id(wsi, h2n->sid); in lws_h2_parse_frame_header()
1190 (unsigned int)h2n->sid, h2n->swsi); in lws_h2_parse_frame_header()
1191 if (!h2n->swsi) in lws_h2_parse_frame_header()
1198 if (!h2n->swsi) { in lws_h2_parse_frame_header()
1213 h2n->swsi = lws_wsi_server_new(wsi->vhost, wsi, in lws_h2_parse_frame_header()
1215 if (!h2n->swsi) { in lws_h2_parse_frame_header()
1222 h2n->swsi->h2.initialized = 1; in lws_h2_parse_frame_header()
1224 if (lws_h2_update_peer_txcredit(h2n->swsi, in lws_h2_parse_frame_header()
1225 h2n->swsi->mux.my_sid, 4 * 65536)) in lws_h2_parse_frame_header()
1233 if (!h2n->swsi->http.ah) in lws_h2_parse_frame_header()
1234 if (lws_header_table_attach(h2n->swsi, 0)) { in lws_h2_parse_frame_header()
1256 if (lws_check_opt(h2n->swsi->vhost->options, in lws_h2_parse_frame_header()
1264 lws_mux_mark_immortal(h2n->swsi); in lws_h2_parse_frame_header()
1266 __func__, h2n->swsi); in lws_h2_parse_frame_header()
1269 h2n->swsi->h2.END_STREAM = in lws_h2_parse_frame_header()
1272 h2n->swsi->h2.END_STREAM); in lws_h2_parse_frame_header()
1282 h2n->swsi->h2.END_HEADERS = in lws_h2_parse_frame_header()
1284 lwsl_info("%p: END_HEADERS %d\n", h2n->swsi, in lws_h2_parse_frame_header()
1285 h2n->swsi->h2.END_HEADERS); in lws_h2_parse_frame_header()
1286 if (h2n->swsi->h2.END_HEADERS) in lws_h2_parse_frame_header()
1288 lwsl_debug("END_HEADERS %d\n", h2n->swsi->h2.END_HEADERS); in lws_h2_parse_frame_header()
1359 h2n->swsi = lws_wsi_mux_from_id(wsi, h2n->sid); in lws_h2_parse_end_of_frame()
1388 h2n->swsi = lws_wsi_server_new(wsi->vhost, wsi, 1); in lws_h2_parse_end_of_frame()
1389 if (!h2n->swsi) in lws_h2_parse_end_of_frame()
1393 assert(lws_wsi_mux_from_id(wsi, 1) == h2n->swsi); in lws_h2_parse_end_of_frame()
1399 lws_role_transition(h2n->swsi, LWSIFR_CLIENT, in lws_h2_parse_end_of_frame()
1404 h2n->swsi->http.ah = wsi->http.ah; in lws_h2_parse_end_of_frame()
1405 h2n->swsi->client_mux_substream = 1; in lws_h2_parse_end_of_frame()
1407 h2n->swsi->flags = wsi->flags; in lws_h2_parse_end_of_frame()
1410 h2n->swsi->protocol = wsi->protocol; in lws_h2_parse_end_of_frame()
1411 if (h2n->swsi->user_space && in lws_h2_parse_end_of_frame()
1412 !h2n->swsi->user_space_externally_allocated) in lws_h2_parse_end_of_frame()
1413 lws_free(h2n->swsi->user_space); in lws_h2_parse_end_of_frame()
1414 h2n->swsi->user_space = wsi->user_space; in lws_h2_parse_end_of_frame()
1415 h2n->swsi->user_space_externally_allocated = in lws_h2_parse_end_of_frame()
1417 h2n->swsi->opaque_user_data = wsi->opaque_user_data; in lws_h2_parse_end_of_frame()
1419 h2n->swsi->txc.manual_initial_tx_credit = in lws_h2_parse_end_of_frame()
1424 if (h2n->swsi->http.ah) in lws_h2_parse_end_of_frame()
1425 h2n->swsi->http.ah->wsi = h2n->swsi; in lws_h2_parse_end_of_frame()
1429 wsi, h2n->swsi); in lws_h2_parse_end_of_frame()
1430 h2n->swsi->txc.tx_cr = in lws_h2_parse_end_of_frame()
1433 __func__, h2n->swsi, (int)h2n->swsi->txc.tx_cr); in lws_h2_parse_end_of_frame()
1434 h2n->swsi->h2.initialized = 1; in lws_h2_parse_end_of_frame()
1447 lws_callback_on_writable(h2n->swsi); in lws_h2_parse_end_of_frame()
1470 if (!h2n->swsi) in lws_h2_parse_end_of_frame()
1481 if (!h2n->swsi->h2.END_HEADERS) { in lws_h2_parse_end_of_frame()
1502 switch (h2n->swsi->h2.h2_state) { in lws_h2_parse_end_of_frame()
1504 lws_h2_state(h2n->swsi, LWS_H2_STATE_OPEN); in lws_h2_parse_end_of_frame()
1507 lws_h2_state(h2n->swsi, LWS_H2_STATE_HALF_CLOSED_LOCAL); in lws_h2_parse_end_of_frame()
1511 lwsl_info("http req, wsi=%p, h2n->swsi=%p\n", wsi, h2n->swsi); in lws_h2_parse_end_of_frame()
1512 h2n->swsi->hdr_parsing_completed = 1; in lws_h2_parse_end_of_frame()
1515 if (h2n->swsi->client_mux_substream && in lws_h2_parse_end_of_frame()
1516 lws_client_interpret_server_handshake(h2n->swsi)) { in lws_h2_parse_end_of_frame()
1522 if (lws_hdr_extant(h2n->swsi, WSI_TOKEN_HTTP_CONTENT_LENGTH)) { in lws_h2_parse_end_of_frame()
1523 h2n->swsi->http.rx_content_length = atoll( in lws_h2_parse_end_of_frame()
1524 lws_hdr_simple_ptr(h2n->swsi, in lws_h2_parse_end_of_frame()
1526 h2n->swsi->http.rx_content_remain = in lws_h2_parse_end_of_frame()
1527 h2n->swsi->http.rx_content_length; in lws_h2_parse_end_of_frame()
1529 (long long)h2n->swsi->http.rx_content_length); in lws_h2_parse_end_of_frame()
1544 len = lws_hdr_total_length(h2n->swsi, n); in lws_h2_parse_end_of_frame()
1550 if (lws_hdr_copy(h2n->swsi, buf, sizeof buf, in lws_h2_parse_end_of_frame()
1564 if (h2n->swsi->h2.h2_state == LWS_H2_STATE_HALF_CLOSED_REMOTE || in lws_h2_parse_end_of_frame()
1565 h2n->swsi->h2.h2_state == LWS_H2_STATE_CLOSED) { in lws_h2_parse_end_of_frame()
1571 switch (h2n->swsi->h2.h2_state) { in lws_h2_parse_end_of_frame()
1573 if (h2n->swsi->h2.END_STREAM) in lws_h2_parse_end_of_frame()
1574 lws_h2_state(h2n->swsi, in lws_h2_parse_end_of_frame()
1578 if (h2n->swsi->h2.END_STREAM) in lws_h2_parse_end_of_frame()
1579 lws_h2_state(h2n->swsi, LWS_H2_STATE_CLOSED); in lws_h2_parse_end_of_frame()
1584 if (h2n->swsi->client_mux_substream) { in lws_h2_parse_end_of_frame()
1590 if (!lws_hdr_total_length(h2n->swsi, WSI_TOKEN_HTTP_COLON_PATH) || in lws_h2_parse_end_of_frame()
1591 !lws_hdr_total_length(h2n->swsi, WSI_TOKEN_HTTP_COLON_METHOD) || in lws_h2_parse_end_of_frame()
1592 !lws_hdr_total_length(h2n->swsi, WSI_TOKEN_HTTP_COLON_SCHEME) || in lws_h2_parse_end_of_frame()
1593 lws_hdr_total_length(h2n->swsi, WSI_TOKEN_HTTP_COLON_STATUS) || in lws_h2_parse_end_of_frame()
1594 lws_hdr_extant(h2n->swsi, WSI_TOKEN_CONNECTION)) { in lws_h2_parse_end_of_frame()
1600 if (lws_hdr_extant(h2n->swsi, WSI_TOKEN_TE)) { in lws_h2_parse_end_of_frame()
1601 n = lws_hdr_total_length(h2n->swsi, WSI_TOKEN_TE); in lws_h2_parse_end_of_frame()
1604 strncmp(lws_hdr_simple_ptr(h2n->swsi, WSI_TOKEN_TE), in lws_h2_parse_end_of_frame()
1613 lws_http_compression_validate(h2n->swsi); in lws_h2_parse_end_of_frame()
1619 p = lws_hdr_simple_ptr(h2n->swsi, WSI_TOKEN_HTTP_COLON_METHOD); in lws_h2_parse_end_of_frame()
1626 h2n->swsi->http.ah->frag_index[method_index[n]] = in lws_h2_parse_end_of_frame()
1627 h2n->swsi->http.ah->frag_index[ in lws_h2_parse_end_of_frame()
1633 (unsigned int)h2n->swsi->wsistate); in lws_h2_parse_end_of_frame()
1634 lwsi_set_state(h2n->swsi, LRS_DEFERRING_ACTION); in lws_h2_parse_end_of_frame()
1635 lws_callback_on_writable(h2n->swsi); in lws_h2_parse_end_of_frame()
1640 if (!h2n->swsi) in lws_h2_parse_end_of_frame()
1643 if (lws_hdr_total_length(h2n->swsi, in lws_h2_parse_end_of_frame()
1645 h2n->swsi->h2.END_STREAM && in lws_h2_parse_end_of_frame()
1646 h2n->swsi->http.rx_content_length && in lws_h2_parse_end_of_frame()
1647 h2n->swsi->http.rx_content_remain) { in lws_h2_parse_end_of_frame()
1648 lws_h2_rst_stream(h2n->swsi, H2_ERR_PROTOCOL_ERROR, in lws_h2_parse_end_of_frame()
1653 if (h2n->swsi->h2.END_STREAM && in lws_h2_parse_end_of_frame()
1654 h2n->swsi->h2.h2_state == LWS_H2_STATE_OPEN) in lws_h2_parse_end_of_frame()
1655 lws_h2_state(h2n->swsi, in lws_h2_parse_end_of_frame()
1658 if (h2n->swsi->h2.END_STREAM && in lws_h2_parse_end_of_frame()
1659 h2n->swsi->h2.h2_state == LWS_H2_STATE_HALF_CLOSED_LOCAL) in lws_h2_parse_end_of_frame()
1660 lws_h2_state(h2n->swsi, LWS_H2_STATE_CLOSED); in lws_h2_parse_end_of_frame()
1668 if (h2n->swsi->client_mux_substream && in lws_h2_parse_end_of_frame()
1671 __func__, h2n->swsi); in lws_h2_parse_end_of_frame()
1673 if (h2n->swsi->h2.h2_state == LWS_H2_STATE_OPEN) { in lws_h2_parse_end_of_frame()
1674 lws_h2_state(h2n->swsi, in lws_h2_parse_end_of_frame()
1685 lws_h2_state(h2n->swsi, LWS_H2_STATE_CLOSED); in lws_h2_parse_end_of_frame()
1687 lws_h2_rst_stream(h2n->swsi, H2_ERR_NO_ERROR, in lws_h2_parse_end_of_frame()
1690 if (lws_http_transaction_completed_client(h2n->swsi)) in lws_h2_parse_end_of_frame()
1726 eff_wsi = h2n->swsi; in lws_h2_parse_end_of_frame()
1744 lws_h2_rst_stream(h2n->swsi, in lws_h2_parse_end_of_frame()
1941 if (!h2n->swsi) in lws_h2_parser()
1943 if (lws_hpack_interpret(h2n->swsi, c)) { in lws_h2_parser()
1996 if (!h2n->swsi) in lws_h2_parser()
2000 &h2n->swsi->buflist, NULL)) in lws_h2_parser()
2004 if (lwsi_role_http(h2n->swsi) && in lws_h2_parser()
2005 lwsi_state(h2n->swsi) == LRS_ESTABLISHED) { in lws_h2_parser()
2006 lwsi_set_state(h2n->swsi, LRS_BODY); in lws_h2_parser()
2008 __func__, h2n->swsi); in lws_h2_parser()
2011 if (lws_hdr_total_length(h2n->swsi, in lws_h2_parser()
2013 h2n->swsi->http.rx_content_length && in lws_h2_parser()
2014 h2n->swsi->http.rx_content_remain < in lws_h2_parser()
2036 if (h2n->swsi->client_mux_substream) { in lws_h2_parser()
2037 if (!h2n->swsi->protocol) { in lws_h2_parser()
2039 __func__, h2n->swsi); in lws_h2_parser()
2042 h2n->swsi->txc.peer_tx_cr_est -= n; in lws_h2_parser()
2044 lws_wsi_txc_describe(&h2n->swsi->txc, in lws_h2_parser()
2046 h2n->swsi->mux.my_sid); in lws_h2_parser()
2048 h2n->swsi->protocol->callback, in lws_h2_parser()
2049 h2n->swsi, in lws_h2_parser()
2051 h2n->swsi->user_space, in lws_h2_parser()
2070 if (lwsi_state(h2n->swsi) == LRS_DEFERRING_ACTION) { in lws_h2_parser()
2072 &h2n->swsi->buflist, in - 1, n); in lws_h2_parser()
2082 &h2n->swsi->dll_buflist, in lws_h2_parser()
2094 h2n->swsi->outer_will_close = 1; in lws_h2_parser()
2101 n = lws_read_h1(h2n->swsi, in - 1, n); in lws_h2_parser()
2103 h2n->swsi->outer_will_close = 0; in lws_h2_parser()
2128 h2n->swsi->txc.peer_tx_cr_est -= n; in lws_h2_parser()
2134 if (!(h2n->swsi->flags & LCCSCF_H2_MANUAL_RXFLOW)) in lws_h2_parser()
2148 lws_h2_update_peer_txcredit_thresh(h2n->swsi, in lws_h2_parser()
2160 h2n->swsi->txc.manual = 1; in lws_h2_parser()
2282 lws_close_free_wsi(h2n->swsi, 0, "close_swsi_and_return"); in lws_h2_parser()
2283 h2n->swsi = NULL; in lws_h2_parser()