Tweak evhttp_parse_query hack to avoid breaking abi

This commit is contained in:
Nick Mathewson 2010-10-06 12:35:38 -04:00
parent b1756d019d
commit 3b84489385
2 changed files with 22 additions and 2 deletions

16
http.c
View File

@ -2400,7 +2400,7 @@ evhttp_decode_uri(const char *uri)
*/ */
int int
evhttp_parse_query(const char *uri, struct evkeyvalq *headers) evhttp_parse_query__checked_20(const char *uri, struct evkeyvalq *headers)
{ {
char *line; char *line;
char *argument; char *argument;
@ -2454,6 +2454,20 @@ done:
return result; 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 * static struct evhttp_cb *
evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req) evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req)
{ {

View File

@ -543,7 +543,13 @@ char *evhttp_decode_uri(const char *uri);
@param headers the head of the evkeyval queue @param headers the head of the evkeyval queue
@return 0 on success, -1 on failure @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. * Escape HTML character entities in a string.