diff --git a/ChangeLog b/ChangeLog index 384a2786..43925821 100644 --- a/ChangeLog +++ b/ChangeLog @@ -78,7 +78,7 @@ Changes in current version: o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents o convert evhttp_connection to use bufferevents. o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy. - + o Remove the never-exported, never-used evhttp_hostportfile function. Changes in 1.4.0: o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. diff --git a/evhttp.h b/evhttp.h index 3b881110..54c504b5 100644 --- a/evhttp.h +++ b/evhttp.h @@ -362,18 +362,6 @@ void evhttp_parse_query(const char *uri, struct evkeyvalq *); */ 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 - * @param pport pointer in which to store the port number - * @param pfile pointer in which to store the pointer to the path - * @return 0 on success and -1 on failure - */ -int evhttp_hostportfile(const char *url, char **phost, u_short *pport, char **pfile); - #ifdef __cplusplus } #endif diff --git a/http.c b/http.c index a29bf036..e78954b6 100644 --- a/http.c +++ b/http.c @@ -466,63 +466,6 @@ evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req) } } -/* Separate host, port and file from URI */ - -int -evhttp_hostportfile(const char *url, char **phost, u_short *pport, char **pfile) -{ - /* XXX not threadsafe. */ - static char host[1024]; - static char file[1024]; - char *p; - const char *p2; - int len; - u_short port; - - len = strlen(HTTP_PREFIX); - if (strncasecmp(url, HTTP_PREFIX, len)) - return (-1); - - url += len; - - /* We might overrun */ - if (strlcpy(host, url, sizeof (host)) >= sizeof(host)) - return (-1); - - p = strchr(host, '/'); - if (p != NULL) { - *p = '\0'; - p2 = p + 1; - } else - p2 = NULL; - - if (pfile != NULL) { - /* Generate request file */ - if (p2 == NULL) - p2 = ""; - snprintf(file, sizeof(file), "/%s", p2); - } - - p = strchr(host, ':'); - if (p != NULL) { - *p = '\0'; - port = atoi(p + 1); - - if (port == 0) - return (-1); - } else - port = HTTP_DEFAULTPORT; - - if (phost != NULL) - *phost = host; - if (pport != NULL) - *pport = port; - if (pfile != NULL) - *pfile = file; - - return (0); -} - static int evhttp_connection_incoming_fail(struct evhttp_request *req, enum evhttp_connection_error error) diff --git a/test/regress_http.c b/test/regress_http.c index c6a1d140..8b3ba674 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -1632,8 +1632,6 @@ static void http_primitives(void) { char *escaped; - char *host = NULL, *path = NULL; - unsigned short port = 0; fprintf(stdout, "Testing HTTP Primitives: "); escaped = evhttp_htmlescape("