1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

http2 handle error path on ensure_user_space

Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
Andy Green 2016-04-23 09:36:18 +08:00
parent 2f216280f8
commit 8dd32ae7c1

View file

@ -64,8 +64,7 @@ lws_create_server_child_wsi(struct lws_vhost *vhost, struct lws *parent_wsi,
if (parent_wsi->u.http2.child_count + 1 ==
parent_wsi->u.http2.peer_settings.setting[
LWS_HTTP2_SETTINGS__MAX_CONCURRENT_STREAMS])
return NULL;
goto bail;
lws_http2_init(&wsi->u.http2.peer_settings);
lws_http2_init(&wsi->u.http2.my_settings);
wsi->u.http2.stream_id = sid;
@ -83,12 +82,20 @@ lws_create_server_child_wsi(struct lws_vhost *vhost, struct lws *parent_wsi,
wsi->mode = parent_wsi->mode;
wsi->protocol = &vhost->protocols[0];
lws_ensure_user_space(wsi);
if (lws_ensure_user_space(wsi))
goto bail;
lwsl_info("%s: %p new child %p, sid %d, user_space=%p\n", __func__,
parent_wsi, wsi, sid, wsi->user_space);
return wsi;
bail:
vhost->protocols[0].callback(wsi, LWS_CALLBACK_WSI_DESTROY,
NULL, NULL, 0);
lws_free(wsi);
return NULL;
}
int lws_remove_server_child_wsi(struct lws_context *context, struct lws *wsi)