【问题标题】:G-WAN v.7.12.6 content type handlers not workG-WAN v.7.12.6 内容类型处理程序不起作用
【发布时间】:2016-11-08 05:02:33
【问题描述】:

我在 .../csp 文件夹中制作了一个 html.c 脚本,如下所示。它应该输出带有默认标题的附加标题。但是,实际上它只输出默认标题。
我做错了什么?我错过了什么吗?

或者,它是 G-WAN 中的错误吗?

#include "gwan.h" // G-WAN exported functions

#define CACHE "Expires: Fri, May 02 2042 00:00:00 GMT\r\nCache-Control: max-age=99999999\r\n"  

int main(int argc, char *argv[ ])
{
    char  cache[ ] = CACHE;
    http_header(HEAD_ADD, cache, sizeof(CACHE) - 1, argv);
    return 200;
}

【问题讨论】:

    标签: g-wan


    【解决方案1】:

    我现在无法检查代码,但我的猜测是 http_header() 从未在 content-type handler 中使用过(仅来自 servlets,就像在 G-WAN 示例中所做的那样)。

    可能只是http_header() 分配的结构从未使用过。 http_header() 可以方便地为您完成工作,而 G-WAN handler 示例展示了如何构建或访问回复缓冲区,以便您可以从此时开始执行所需的任何标头版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-28
      • 1970-01-01
      • 2016-05-04
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多