Revision: 14687 Author: adrian.chadd Date: Sun May 23 00:35:08 2010 Log: Migrate url_convert_hex() out of src/url.c
http://code.google.com/p/lusca-cache/source/detail?r=14687 Modified: /branches/LUSCA_HEAD/src/gopher.c /branches/LUSCA_HEAD/src/protos.h /branches/LUSCA_HEAD/src/url.c ======================================= --- /branches/LUSCA_HEAD/src/gopher.c Mon Feb 2 10:32:22 2009 +++ /branches/LUSCA_HEAD/src/gopher.c Sun May 23 00:35:08 2010 @@ -35,6 +35,8 @@ #include "squid.h" +#include "../libsqurl/url.h" + /* gopher type code from rfc. Anawat. */ #define GOPHER_FILE '0' #define GOPHER_DIRECTORY '1' ======================================= --- /branches/LUSCA_HEAD/src/protos.h Wed Apr 21 07:26:39 2010 +++ /branches/LUSCA_HEAD/src/protos.h Sun May 23 00:35:08 2010 @@ -781,7 +781,7 @@ extern void unlinkdUnlink(const char *); #endif -extern char *url_convert_hex(char *org_url, int allocate); +/* url.c */ extern char *url_escape(const char *url); extern protocol_t urlParseProtocol(const char *); extern void urlInitialize(void); ======================================= --- /branches/LUSCA_HEAD/src/url.c Thu Apr 1 23:26:01 2010 +++ /branches/LUSCA_HEAD/src/url.c Sun May 23 00:35:08 2010 @@ -63,34 +63,6 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789-."; - -/* convert %xx in url string to a character - * Allocate a new string and return a pointer to converted string */ - -char * -url_convert_hex(char *org_url, int allocate) -{ - static char code[] = "00"; - char *url = NULL; - char *s = NULL; - char *t = NULL; - url = allocate ? (char *) xstrdup(org_url) : org_url; - if ((int) strlen(url) < 3 || !strchr(url, '%')) - return url; - for (s = t = url; *s; s++) { - if (*s == '%' && *(s + 1) && *(s + 2)) { - code[0] = *(++s); - code[1] = *(++s); - *t++ = (char) strtol(code, NULL, 16); - } else { - *t++ = *s; - } - } - do { - *t++ = *s; - } while (*s++); - return url; -} void urlInitialize(void) -- You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en.
