doc: Update tutorial

This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-18 13:14:07 +09:00
parent ae74a18624
commit 323c3b4225
2 changed files with 9 additions and 2 deletions

View File

@ -260,7 +260,11 @@ data is available to read in the bufferevent input buffer::
delete_http2_session_data(session_data); delete_http2_session_data(session_data);
return; 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) { if(session_send(session_data) != 0) {
delete_http2_session_data(session_data); delete_http2_session_data(session_data);
return; return;

View File

@ -296,7 +296,10 @@ functions for these pending data. To process received data, we call
warnx("Fatal error: %s", nghttp2_strerror((int)readlen)); warnx("Fatal error: %s", nghttp2_strerror((int)readlen));
return -1; 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) { if(session_send(session_data) != 0) {
return -1; return -1;
} }