分类:
2006-03-03 00:34:24
diff -urN squid-2.5.STABLE6.orig/lib/html_quote.c squid-2.5.STABLE6/lib/html_quote.c --- squid-2.5.STABLE6.orig/lib/html_quote.c 2001-10-18 03:46:43.000000000 +0800 +++ squid-2.5.STABLE6/lib/html_quote.c 2006-03-02 22:32:37.000000000 +0800 @@ -114,7 +114,8 @@ * sure all 8-bit characters are encoded to protect from buggy * clients */ - if (!escape && (ch <= 0x1F || ch >= 0x7f) && ch != '\n' && ch != '\r' && ch != '\t') { + if (!escape && (ch <= 0x1F || ch == 0x7f || ch > 0xfd) + && ch != '\n' && ch != '\r' && ch != '\t') { static char dec_encoded[7]; snprintf(dec_encoded, sizeof dec_encoded, "%3d;", (int) ch); escape = dec_encoded; diff -urN squid-2.5.STABLE6.orig/src/ftp.c squid-2.5.STABLE6/src/ftp.c --- squid-2.5.STABLE6.orig/src/ftp.c 2004-06-01 07:14:37.000000000 +0800 +++ squid-2.5.STABLE6/src/ftp.c 2006-03-02 22:26:42.000000000 +0800 @@ -1027,6 +1027,7 @@ static void ftpBuildTitleUrl(FtpStateData * ftpState) { + char *tmp; request_t *request = ftpState->request; stringReset(&ftpState->title_url, "ftp://"); @@ -1039,7 +1040,10 @@ strCat(ftpState->title_url, ":"); strCat(ftpState->title_url, xitoa(request->port)); } - strCat(ftpState->title_url, strBuf(request->urlpath)); + tmp = xmalloc(strlen(strBuf(request->urlpath)) + 1); + strcpy(tmp, strBuf(request->urlpath)); + rfc1738_unescape(tmp); + strCat(ftpState->title_url, tmp); stringReset(&ftpState->base_href, "ftp://"); if (strcmp(ftpState->user, "anonymous")) { @@ -1055,8 +1059,9 @@ strCat(ftpState->base_href, ":"); strCat(ftpState->base_href, xitoa(request->port)); } - strCat(ftpState->base_href, strBuf(request->urlpath)); + strCat(ftpState->base_href, tmp); strCat(ftpState->base_href, "/"); + xfree(tmp); } CBDATA_TYPE(FtpStateData); |