examples: Check return value of evbuffer_drain
This commit is contained in:
parent
4fdc274a42
commit
85a43cfa66
|
@ -425,7 +425,11 @@ static void readcb(struct bufferevent *bev, void *ptr)
|
|||
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;
|
||||
|
|
|
@ -250,7 +250,10 @@ static int session_recv(http2_session_data *session_data)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue