diff --git a/doc/sources/tutorial-client.rst b/doc/sources/tutorial-client.rst index 98ad8baa..78c55038 100644 --- a/doc/sources/tutorial-client.rst +++ b/doc/sources/tutorial-client.rst @@ -249,17 +249,18 @@ data is available to read in the bufferevent input buffer:: static void readcb(struct bufferevent *bev, void *ptr) { http2_session_data *session_data = (http2_session_data*)ptr; - int rv; + ssize_t readlen; struct evbuffer *input = bufferevent_get_input(bev); size_t datalen = evbuffer_get_length(input); unsigned char *data = evbuffer_pullup(input, -1); - rv = nghttp2_session_mem_recv(session_data->session, data, datalen); - if(rv < 0) { - warnx("Fatal error: %s", nghttp2_strerror(rv)); + + readlen = nghttp2_session_mem_recv(session_data->session, data, datalen); + if(readlen < 0) { + warnx("Fatal error: %s", nghttp2_strerror((int)readlen)); delete_http2_session_data(session_data); return; } - evbuffer_drain(input, rv); + evbuffer_drain(input, readlen); 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 a39ef51d..59705466 100644 --- a/doc/sources/tutorial-server.rst +++ b/doc/sources/tutorial-server.rst @@ -34,11 +34,10 @@ life time:: void *arg) { *data = next_proto_list; - *len = next_proto_list_len; + *len = (unsigned int)next_proto_list_len; return SSL_TLSEXT_ERR_OK; } - static SSL_CTX* create_ssl_ctx(const char *key_file, const char *cert_file) { SSL_CTX *ssl_ctx; @@ -287,16 +286,17 @@ functions for these pending data. To process received data, we call static int session_recv(http2_session_data *session_data) { - int rv; + ssize_t readlen; struct evbuffer *input = bufferevent_get_input(session_data->bev); size_t datalen = evbuffer_get_length(input); unsigned char *data = evbuffer_pullup(input, -1); - rv = nghttp2_session_mem_recv(session_data->session, data, datalen); - if(rv < 0) { - warnx("Fatal error: %s", nghttp2_strerror(rv)); + + readlen = nghttp2_session_mem_recv(session_data->session, data, datalen); + if(readlen < 0) { + warnx("Fatal error: %s", nghttp2_strerror((int)readlen)); return -1; } - evbuffer_drain(input, rv); + evbuffer_drain(input, readlen); if(session_send(session_data) != 0) { return -1; }