From 323c3b4225056e433c84ebda5cc7e43036aba923 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 18 Jun 2014 13:14:07 +0900 Subject: [PATCH] doc: Update tutorial --- doc/sources/tutorial-client.rst | 6 +++++- doc/sources/tutorial-server.rst | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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; }