From 3b844893859c08a17c039dccef2e07e42e7c2f69 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 6 Oct 2010 12:35:38 -0400 Subject: [PATCH] Tweak evhttp_parse_query hack to avoid breaking abi --- http.c | 16 +++++++++++++++- include/event2/http.h | 8 +++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index 30b09e9e..979aece9 100644 --- a/http.c +++ b/http.c @@ -2400,7 +2400,7 @@ evhttp_decode_uri(const char *uri) */ int -evhttp_parse_query(const char *uri, struct evkeyvalq *headers) +evhttp_parse_query__checked_20(const char *uri, struct evkeyvalq *headers) { char *line; char *argument; @@ -2454,6 +2454,20 @@ done: return result; } +#undef evhttp_parse_query +void evhttp_parse_query(const char *uri, struct evkeyvalq *headers); +/* We define this here so as to avoid changing the ABI for evhttp_parse_query + * in 2.0.8. The next time we break ABI compatibility, we can go back to + * having the function above be called evhttp_parse_query + */ +void +evhttp_parse_query(const char *uri, struct evkeyvalq *headers) +{ + evhttp_parse_query__checked_20(uri, headers); +} + + + static struct evhttp_cb * evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req) { diff --git a/include/event2/http.h b/include/event2/http.h index 10822b93..b4bb853d 100644 --- a/include/event2/http.h +++ b/include/event2/http.h @@ -543,7 +543,13 @@ char *evhttp_decode_uri(const char *uri); @param headers the head of the evkeyval queue @return 0 on success, -1 on failure */ -int evhttp_parse_query(const char *uri, struct evkeyvalq *headers); +#define evhttp_parse_query(uri, headers) \ + evhttp_parse_query__checked_20((uri), (headers)) + +/* Do not call this function directly; it is a temporary alias introduced + * to avoid changing the old signature for evhttp_parse_query + */ +int evhttp_parse_query__checked_20(const char *uri, struct evkeyvalq *headers); /** * Escape HTML character entities in a string. -- 2.40.0