HTTP2: Update to libnghttp2 1.0.4

Change-Id: Ia92d183b7e7b5a604d75eee13b64b827ad0af903
Reviewed-on: https://code.wireshark.org/review/9054
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2015-06-23 15:17:10 +02:00 committed by Anders Broman
parent ae92a8347e
commit d0faa9adf8
5 changed files with 34 additions and 7 deletions

View File

@ -29,8 +29,6 @@ find . -name "nghttp2*" -type f -exec sed -i 's/"nghttp2_net.h"/<glib.h>/g' {}
Fix c++-compat error and documentation (struct => typedef) error
in nghttp2/nghttp2_helper.h remove check for CONFIG.H
in nghttp2/nghttp2.h
Add on the top

View File

@ -53,8 +53,12 @@ extern "C" {
#ifdef NGHTTP2_STATICLIB
#define NGHTTP2_EXTERN
#elif defined(WIN32)
#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __declspec(dllexport)
#else /* !defined(WIN32) */
#else /* !BUILDING_NGHTTP2 */
#define NGHTTP2_EXTERN __declspec(dllimport)
#endif /* !BUILDING_NGHTTP2 */
#else /* !defined(WIN32) */
#define NGHTTP2_EXTERN
#endif /* !defined(WIN32) */
@ -1150,6 +1154,15 @@ typedef union {
*
* To set this callback to :type:`nghttp2_session_callbacks`, use
* `nghttp2_session_callbacks_set_send_callback()`.
*
* .. note::
*
* The |length| may be very small. If that is the case, and
* application disables Nagle algorithm (``TCP_NODELAY``), then just
* writing |data| to the network stack leads to very small packet,
* and it is very inefficient. An application should be responsible
* to buffer up small chunks of data as necessary to avoid this
* situation.
*/
typedef ssize_t (*nghttp2_send_callback)(nghttp2_session *session,
const uint8_t *data, size_t length,
@ -2258,6 +2271,15 @@ NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session);
*
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
*
* .. note::
*
* This function may produce very small byte string. If that is the
* case, and application disables Nagle algorithm (``TCP_NODELAY``),
* then writing this small chunk leads to very small packet, and it
* is very inefficient. An application should be responsible to
* buffer up small chunks of data as necessary to avoid this
* situation.
*/
NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session,
const uint8_t **data_ptr);

View File

@ -544,7 +544,8 @@ int nghttp2_hd_entry_init(nghttp2_hd_entry *ent, uint8_t flags, uint8_t *name,
return 0;
fail2:
if (flags & NGHTTP2_HD_FLAG_NAME_ALLOC) {
if ((flags & NGHTTP2_HD_FLAG_NAME_ALLOC) &&
(flags & NGHTTP2_HD_FLAG_NAME_GIFT) == 0) {
nghttp2_mem_free(mem, ent->nv.name);
}
fail:
@ -1894,7 +1895,11 @@ static int hd_inflate_commit_indname(nghttp2_hd_inflater *inflater,
return 0;
}
nghttp2_mem_free(mem, nv.value);
if (inflater->index < NGHTTP2_STATIC_TABLE_LENGTH) {
nghttp2_mem_free(mem, nv.value);
} else {
nghttp2_mem_free(mem, nv.name);
}
return NGHTTP2_ERR_NOMEM;
}

View File

@ -25,7 +25,9 @@
#ifndef NGHTTP2_HELPER_H
#define NGHTTP2_HELPER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <string.h>

View File

@ -29,7 +29,7 @@
* @macro
* Version number of the nghttp2 library release
*/
#define NGHTTP2_VERSION "1.0.0"
#define NGHTTP2_VERSION "1.0.4"
/**
* @macro
@ -37,6 +37,6 @@
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define NGHTTP2_VERSION_NUM 0x010000
#define NGHTTP2_VERSION_NUM 0x010004
#endif /* NGHTTP2VER_H */