Lines Matching refs:h2_session
3130 static int http2_session_server_create(struct http2_session* h2_session)
3132 log_assert(h2_session->callbacks);
3133 h2_session->is_drop = 0;
3134 if(nghttp2_session_server_new(&h2_session->session,
3135 h2_session->callbacks,
3136 h2_session) == NGHTTP2_ERR_NOMEM) {
3145 static int http2_submit_settings(struct http2_session* h2_session)
3150 h2_session->c->http2_max_streams}};
3152 ret = nghttp2_submit_settings(h2_session->session, NGHTTP2_FLAG_NONE,
3165 static void http2_stream_delete(struct http2_session* h2_session,
3170 h2_session->c);
3179 static void http2_session_server_delete(struct http2_session* h2_session)
3183 nghttp2_session_del(h2_session->session); /* NULL input is fine */
3184 h2_session->session = NULL;
3185 for(h2_stream = h2_session->first_stream; h2_stream;) {
3187 http2_stream_delete(h2_session, h2_stream);
3190 h2_session->first_stream = NULL;
3191 h2_session->is_drop = 0;
3192 h2_session->postpone_drop = 0;
3193 h2_session->c->h2_stream = NULL;
3195 (void)h2_session;
3227 if(!c_hdl->h2_session ||
3228 !http2_session_server_create(c_hdl->h2_session)) {
3232 if(!c_hdl->h2_session ||
3233 !http2_submit_settings(c_hdl->h2_session)) {
3235 if(c_hdl->h2_session)
3236 http2_session_server_delete(c_hdl->h2_session);
3255 if(c_hdl->type == comm_http && c_hdl->h2_session)
3256 http2_session_server_delete(c_hdl->h2_session);
3266 if(c_hdl->type == comm_http && c_hdl->h2_session)
3267 http2_session_server_delete(c_hdl->h2_session);
3545 if(c->type == comm_http && c->h2_session) {
5063 static void http2_session_delete(struct http2_session* h2_session)
5066 if(h2_session->callbacks)
5067 nghttp2_session_callbacks_del(h2_session->callbacks);
5068 free(h2_session);
5070 (void)h2_session;
5102 void http2_session_add_stream(struct http2_session* h2_session,
5105 if(h2_session->first_stream)
5106 h2_session->first_stream->prev = h2_stream;
5107 h2_stream->next = h2_session->first_stream;
5108 h2_session->first_stream = h2_stream;
5113 static void http2_session_remove_stream(struct http2_session* h2_session,
5119 h2_session->first_stream = h2_stream->next;
5129 struct http2_session* h2_session = (struct http2_session*)cb_arg;
5131 h2_session->session, stream_id))) {
5134 http2_session_remove_stream(h2_session, h2_stream);
5135 http2_stream_delete(h2_session, h2_stream);
5142 struct http2_session* h2_session = (struct http2_session*)cb_arg;
5145 log_assert(h2_session->c->type == comm_http);
5146 log_assert(h2_session->c->h2_session);
5149 if(h2_session->c->ssl) {
5152 r = SSL_read(h2_session->c->ssl, buf, len);
5154 int want = SSL_get_error(h2_session->c->ssl, r);
5160 h2_session->c->ssl_shake_state = comm_ssl_shake_hs_write;
5161 comm_point_listen_for_rw(h2_session->c, 0, 1);
5180 ret = recv(h2_session->c->fd, buf, len, MSG_DONTWAIT);
5192 &h2_session->c->repinfo.remote_addr,
5193 h2_session->c->repinfo.remote_addrlen);
5200 ub_winsock_tcp_wouldblock(h2_session->c->ev->ev,
5206 &h2_session->c->repinfo.remote_addr,
5207 h2_session->c->repinfo.remote_addrlen);
5221 log_assert(c->h2_session);
5224 ret = nghttp2_session_recv(c->h2_session->session);
5236 if(nghttp2_session_want_write(c->h2_session->session)) {
5240 } else if(!nghttp2_session_want_read(c->h2_session->session))
5472 struct http2_session* h2_session = (struct http2_session*)cb_arg;
5473 log_assert(h2_session->c->type == comm_http);
5474 log_assert(h2_session->c->h2_session);
5477 if(h2_session->c->ssl) {
5480 r = SSL_write(h2_session->c->ssl, buf, len);
5482 int want = SSL_get_error(h2_session->c->ssl, r);
5486 h2_session->c->ssl_shake_state = comm_ssl_shake_hs_read;
5487 comm_point_listen_for_rw(h2_session->c, 1, 0);
5508 ret = send(h2_session->c->fd, buf, len, 0);
5524 &h2_session->c->repinfo.remote_addr,
5525 h2_session->c->repinfo.remote_addrlen);
5532 ub_winsock_tcp_wouldblock(h2_session->c->ev->ev,
5540 &h2_session->c->repinfo.remote_addr,
5541 h2_session->c->repinfo.remote_addrlen);
5555 log_assert(c->h2_session);
5557 ret = nghttp2_session_send(c->h2_session->session);
5564 if(nghttp2_session_want_read(c->h2_session->session)) {
5568 } else if(!nghttp2_session_want_write(c->h2_session->session))
6110 if(!(c->h2_session = http2_session_create(c))) {
6119 if(!(c->h2_session->callbacks = http2_req_callbacks_create())) {
6121 http2_session_delete(c->h2_session);
6142 http2_session_delete(c->h2_session);
6542 if(c->h2_session)
6543 http2_session_server_delete(c->h2_session);
6598 if(c->h2_session) {
6599 http2_session_delete(c->h2_session);
6692 if(!http2_submit_dns_response(repinfo->c->h2_session)) {
6725 if(repinfo->c->h2_session) {
6726 repinfo->c->h2_session->is_drop = 1;
6727 if(!repinfo->c->h2_session->postpone_drop)