diff --git a/doc/sources/tutorial-client.rst b/doc/sources/tutorial-client.rst index 11b78803..9deae30d 100644 --- a/doc/sources/tutorial-client.rst +++ b/doc/sources/tutorial-client.rst @@ -269,7 +269,7 @@ data is available to read from the bufferevent input buffer:: delete_http2_session_data(session_data); return; } - if (evbuffer_drain(input, readlen) != 0) { + if (evbuffer_drain(input, (size_t)readlen) != 0) { warnx("Fatal error: evbuffer_drain failed"); delete_http2_session_data(session_data); return; @@ -309,7 +309,7 @@ defined as:: http2_session_data *session_data = (http2_session_data *)user_data; struct bufferevent *bev = session_data->bev; bufferevent_write(bev, data, length); - return length; + return (ssize_t)length; } Since we use bufferevent to abstract network I/O, we just write the diff --git a/doc/sources/tutorial-server.rst b/doc/sources/tutorial-server.rst index 72cd362f..638a0f41 100644 --- a/doc/sources/tutorial-server.rst +++ b/doc/sources/tutorial-server.rst @@ -132,7 +132,7 @@ libevent's ``struct evconnlistener`` is used for this purpose:: struct evconnlistener *listener; listener = evconnlistener_new_bind( 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) { 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)); return -1; } - if (evbuffer_drain(input, readlen) != 0) { + if (evbuffer_drain(input, (size_t)readlen) != 0) { warnx("Fatal error: evbuffer_drain failed"); return -1; } @@ -316,7 +316,7 @@ follows:: return NGHTTP2_ERR_WOULDBLOCK; } bufferevent_write(bev, data, length); - return length; + return (ssize_t)length; } Since we use bufferevent to abstract network I/O, we just write the