Update tutorial

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-23 22:57:53 +09:00
parent 25e2adbfe9
commit c3283e1c6e
2 changed files with 5 additions and 5 deletions

View File

@ -269,7 +269,7 @@ data is available to read from the bufferevent input buffer::
delete_http2_session_data(session_data); delete_http2_session_data(session_data);
return; return;
} }
if (evbuffer_drain(input, readlen) != 0) { if (evbuffer_drain(input, (size_t)readlen) != 0) {
warnx("Fatal error: evbuffer_drain failed"); warnx("Fatal error: evbuffer_drain failed");
delete_http2_session_data(session_data); delete_http2_session_data(session_data);
return; return;
@ -309,7 +309,7 @@ defined as::
http2_session_data *session_data = (http2_session_data *)user_data; http2_session_data *session_data = (http2_session_data *)user_data;
struct bufferevent *bev = session_data->bev; struct bufferevent *bev = session_data->bev;
bufferevent_write(bev, data, length); bufferevent_write(bev, data, length);
return length; return (ssize_t)length;
} }
Since we use bufferevent to abstract network I/O, we just write the Since we use bufferevent to abstract network I/O, we just write the

View File

@ -132,7 +132,7 @@ libevent's ``struct evconnlistener`` is used for this purpose::
struct evconnlistener *listener; struct evconnlistener *listener;
listener = evconnlistener_new_bind( listener = evconnlistener_new_bind(
evbase, acceptcb, app_ctx, LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, evbase, acceptcb, app_ctx, LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE,
16, rp->ai_addr, rp->ai_addrlen); 16, rp->ai_addr, (int)rp->ai_addrlen);
if (listener) { if (listener) {
freeaddrinfo(res); freeaddrinfo(res);
@ -272,7 +272,7 @@ this pending data. To process the received data, we call the
warnx("Fatal error: %s", nghttp2_strerror((int)readlen)); warnx("Fatal error: %s", nghttp2_strerror((int)readlen));
return -1; return -1;
} }
if (evbuffer_drain(input, readlen) != 0) { if (evbuffer_drain(input, (size_t)readlen) != 0) {
warnx("Fatal error: evbuffer_drain failed"); warnx("Fatal error: evbuffer_drain failed");
return -1; return -1;
} }
@ -316,7 +316,7 @@ follows::
return NGHTTP2_ERR_WOULDBLOCK; return NGHTTP2_ERR_WOULDBLOCK;
} }
bufferevent_write(bev, data, length); bufferevent_write(bev, data, length);
return length; return (ssize_t)length;
} }
Since we use bufferevent to abstract network I/O, we just write the Since we use bufferevent to abstract network I/O, we just write the