免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2206 | 回复: 4
打印 上一主题 下一主题

[proxy] 怎样让squid代理的FTP显示图标? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-12 11:50 |只看该作者 |倒序浏览
怎样让squid代理的FTP显示图标?
我使用SQUID 2.5 STABLE6做代理,当我在客户机访问
]ftp://ftp.kernel.org时,所有的图标(文件或目录前的[dir]、[file],文件后的[download]、[view])均无法显示,该如何解决?
FTP Directory: ftp://ftp.kernel.org/
[dirup] Parent Directory (Root Directory)
[dir] for_mirrors_only . . . . . . . . May 21 2001
[dir] lost+found . . . . . . . . . . . Mar 18 2003
[dir] pub. . . . . . . . . . . . . . . Jun 07 18:25

查看[dirup]的属性为:http://xxxx:8080/squid-internal-static/icons/anthony-dirup.gif
查看[dir]的属性为:http://xxxx:8080/squid-internal-static/icons/anthony-dir.gif

论坛徽章:
0
2 [报告]
发表于 2004-09-12 16:38 |只看该作者

怎样让squid代理的FTP显示图标?

没有明白什么意思。

论坛徽章:
0
3 [报告]
发表于 2004-09-13 10:02 |只看该作者

怎样让squid代理的FTP显示图标?

就是说,用SQUID做代理,在客户端(WINDOWS)上用IE访问ftp://www.kernel.org等FTP站点时,所有的图标均无法显示。

论坛徽章:
0
4 [报告]
发表于 2004-09-13 11:19 |只看该作者

怎样让squid代理的FTP显示图标?

在IE设置的高级选项中有一些如"为FTP站点启用文件夹视图"

论坛徽章:
0
5 [报告]
发表于 2004-09-13 15:23 |只看该作者

怎样让squid代理的FTP显示图标?

以下是SQUID中执行FTP代理界面的两个函数,它将所有FTP站点显示成HTML格式,但是它自己自带的图标却无法显示,为什么?
我将Apache启动后故障依旧。

static void
ftpListingStart(FtpStateData * ftpState)
{
    StoreEntry *e = ftpState->;entry;
    wordlist *w;
    char *dirup;
    int i, j, k;
    char *title;
    storeBuffer(e);
    storeAppendPrintf(e, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">;\n";
    storeAppendPrintf(e, "<!-- HTML listing generated by Squid %s -->;\n",
        version_string);
    storeAppendPrintf(e, "<!-- %s -->;\n", mkrfc1123(squid_curtime));
    storeAppendPrintf(e, "<HTML>;<HEAD>;<TITLE>;\n";
    storeAppendPrintf(e, "FTP Directory: %s\n",
        html_quote(strBuf(ftpState->;title_url)));
    storeAppendPrintf(e, "</TITLE>;\n";
    storeAppendPrintf(e, "<STYLE type=\"text/css\">;<!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}-->;</STYLE>;\n";
    if (ftpState->;flags.use_base)
        storeAppendPrintf(e, "<BASE HREF=\"%s\">;\n",
            html_quote(strBuf(ftpState->;base_href)));
    storeAppendPrintf(e, "</HEAD>;<BODY>;\n";
    if (ftpState->;cwd_message) {
        storeAppendPrintf(e, "<RE>;\n";
        for (w = ftpState->;cwd_message; w; w = w->;next)
            storeAppendPrintf(e, "%s\n", html_quote(w->;key));
        storeAppendPrintf(e, "</PRE>;\n";
        storeAppendPrintf(e, "<HR noshade size=\"1px\">;\n";
        wordlistDestroy(&ftpState->;cwd_message);
    }
    storeAppendPrintf(e, "<H2>;\n";
    storeAppendPrintf(e, "FTP Directory: ";
    /* "ftp://" == 6 characters */
    assert(strLen(ftpState->;title_url) >;= 6);
    title = html_quote(strBuf(ftpState->;title_url));
    for (i = 6, j = 0; title; j = i) {
        storeAppendPrintf(e, "<A HREF=\"");
        i += strcspn(&title, "/");
        if (title == '/')
            i++;
        for (k = 0; k < i; k++)
            storeAppendPrintf(e, "%c", title[k]);
        storeAppendPrintf(e, "\">;");
        for (k = j; k < i - 1; k++)
            storeAppendPrintf(e, "%c", title[k]);
        if (strBuf(ftpState->;title_url)[k] != '/')
            storeAppendPrintf(e, "%c", title[k++]);
        storeAppendPrintf(e, "</A>;");
        if (k < i)
            storeAppendPrintf(e, "%c", title[k++]);
        if (i == j) {
            /* Error guard, or "assert" */
            storeAppendPrintf(e, "ERROR: Failed to parse URL: %s\n",
                html_quote(strBuf(ftpState->;title_url)));
            debug(9, 0) ("Failed to parse URL: %s\n", strBuf(ftpState->;title_url));
            break;
        }
    }
    storeAppendPrintf(e, "</H2>;\n");
    storeAppendPrintf(e, "<RE>;\n");
    dirup = ftpHtmlifyListEntry("<internal-dirup>;", ftpState);
    storeAppend(e, dirup, strlen(dirup));
    storeBufferFlush(e);
    ftpState->;flags.html_header_sent = 1;
}

static void
ftpListingFinish(FtpStateData * ftpState)
{
    StoreEntry *e = ftpState->;entry;
    storeBuffer(e);
    storeAppendPrintf(e, "</PRE>;\n");
    if (ftpState->;flags.listformat_unknown && !ftpState->;flags.tried_nlst) {
        storeAppendPrintf(e, "<A HREF=\"./;type=d\">;[As plain directory]</A>;\n");
    } else if (ftpState->;typecode == 'D') {
        storeAppendPrintf(e, "<A HREF=\"./\">;[As extended directory]</A>;\n");
    }
    storeAppendPrintf(e, "<HR noshade size=\"1px\">;\n");
    storeAppendPrintf(e, "<ADDRESS>;\n");
    storeAppendPrintf(e, "Generated %s by %s (%s)\n",
        mkrfc1123(squid_curtime),
        getMyHostname(),
        full_appname_string);
    storeAppendPrintf(e, "</ADDRESS>;</BODY>;</HTML>;\n");
    storeBufferFlush(e);
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP