diff --git a/doc/sources/tutorial-client.rst b/doc/sources/tutorial-client.rst index 78c55038..ff998646 100644 --- a/doc/sources/tutorial-client.rst +++ b/doc/sources/tutorial-client.rst @@ -260,7 +260,11 @@ data is available to read in the bufferevent input buffer:: delete_http2_session_data(session_data); return; } - evbuffer_drain(input, readlen); + if(evbuffer_drain(input, readlen) != 0) { + warnx("Fatal error: evbuffer_drain failed"); + delete_http2_session_data(session_data); + return; + } if(session_send(session_data) != 0) { delete_http2_session_data(session_data); return; diff --git a/doc/sources/tutorial-server.rst b/doc/sources/tutorial-server.rst index 59705466..4da8a667 100644 --- a/doc/sources/tutorial-server.rst +++ b/doc/sources/tutorial-server.rst @@ -296,7 +296,10 @@ functions for these pending data. To process received data, we call warnx("Fatal error: %s", nghttp2_strerror((int)readlen)); return -1; } - evbuffer_drain(input, readlen); + if(evbuffer_drain(input, readlen) != 0) { + warnx("Fatal error: evbuffer_drain failed"); + return -1; + } if(session_send(session_data) != 0) { return -1; }