From: Nick Mathewson Date: Tue, 29 Apr 2008 18:11:10 +0000 (+0000) Subject: r15339@tombo: nickm | 2008-04-29 14:03:48 -0400 X-Git-Tag: release-2.0.1-alpha~353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cff82bb4f2519d139559c308b63be54cb86b002;p=libevent r15339@tombo: nickm | 2008-04-29 14:03:48 -0400 Note that evhttp_hostportfile is not threadsafe, and so its usage will change. Mark its first argument const. Remove a now-redundant declaration for it in http-internal.h. svn:r743 --- diff --git a/evhttp.h b/evhttp.h index 01d6395a..3b881110 100644 --- a/evhttp.h +++ b/evhttp.h @@ -364,6 +364,7 @@ char *evhttp_htmlescape(const char *html); /** * Separate the host, port and path component from a URL. + * XXXX This interface will change before release to become threadsafe. * * @param url the url for which to separate the components * @param phost pointer in which to store the pointer to the host @@ -371,7 +372,7 @@ char *evhttp_htmlescape(const char *html); * @param pfile pointer in which to store the pointer to the path * @return 0 on success and -1 on failure */ -int evhttp_hostportfile(char *url, char **phost, u_short *pport, char **pfile); +int evhttp_hostportfile(const char *url, char **phost, u_short *pport, char **pfile); #ifdef __cplusplus } diff --git a/http-internal.h b/http-internal.h index 48860f0f..96d1f770 100644 --- a/http-internal.h +++ b/http-internal.h @@ -117,8 +117,6 @@ void evhttp_connection_fail(struct evhttp_connection *, void evhttp_get_request(struct evhttp *, evutil_socket_t, struct sockaddr *, socklen_t); -int evhttp_hostportfile(char *, char **, u_short *, char **); - int evhttp_parse_lines(struct evhttp_request *, struct evbuffer*); void evhttp_start_read(struct evhttp_connection *); diff --git a/http.c b/http.c index dd2790c4..a29bf036 100644 --- a/http.c +++ b/http.c @@ -469,7 +469,7 @@ evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req) /* Separate host, port and file from URI */ int -evhttp_hostportfile(char *url, char **phost, u_short *pport, char **pfile) +evhttp_hostportfile(const char *url, char **phost, u_short *pport, char **pfile) { /* XXX not threadsafe. */ static char host[1024]; diff --git a/test/regress_http.c b/test/regress_http.c index c696b1c0..c6a1d140 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -1372,7 +1372,7 @@ http_chunked_request_done(struct evhttp_request *req, void *arg) } static void -http_chunked_test() +http_chunked_test(void) { struct bufferevent *bev; int fd;