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
This commit is contained in:
Nick Mathewson 2008-04-29 18:11:10 +00:00
parent e44ef375ee
commit 4cff82bb4f
4 changed files with 4 additions and 5 deletions

View File

@ -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
}

View File

@ -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 *);

2
http.c
View File

@ -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];

View File

@ -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;