nghttp2: use custom memory functions

Provide libcurl's memory functions as callbacks to replace nghttp2's own memory
functions. This allows custom memory callbacks provided by users of libcurl to
be used by nghttp2 as well.

Closes #15527
This commit is contained in:
Ethan Everett 2024-11-08 11:49:32 -08:00 committed by Daniel Stenberg
parent 1cd745a581
commit 9089ef1f4f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 35 additions and 2 deletions

View file

@ -60,6 +60,11 @@ CURLcode Curl_http2_upgrade(struct Curl_easy *data,
struct connectdata *conn, int sockindex,
const char *ptr, size_t nread);
void *Curl_nghttp2_malloc(size_t size, void *user_data);
void Curl_nghttp2_free(void *ptr, void *user_data);
void *Curl_nghttp2_calloc(size_t nmemb, size_t size, void *user_data);
void *Curl_nghttp2_realloc(void *ptr, size_t size, void *user_data);
extern struct Curl_cftype Curl_cft_nghttp2;
#else /* USE_NGHTTP2 */