我正在使用这个简单的代码。如何禁用READ_XBUF缓存?
#include "gwan.h"
int main(int argc, char *argv[])
{
xbuf_t *reply = get_reply(argv), *read_buff;
read_buff = (xbuf_t*)get_env(argv, READ_XBUF);
xbuf_cat(reply, "START\n"); xbuf_ncat(reply, read_buff->ptr, read_buff->len); xbuf_cat(reply, "END\n");
// this line is important if I don't use read_buff everything seems OK
// but I need parse read_buff :(
printf("%s\n", read_buff->ptr); // this line is most important
return 200;
}
起初一切似乎都OK
壳:〜在seq 0 1
为I $;做卷曲-A“”-H“TST:$ {I}”'http://test.com:8080/?read_buf.c&scp=3';做
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 1
END
执行我的循环再
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 1
END
执行我的循环再
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 1
END
但我的问题。 TST仍然是0?
执行我的循环再
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
执行我的循环再
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
START
GET /?read_buf.cscp=3HTTP/1.1
Host: test.com8080
Accept: */*
TST: 0
END
为什么?由于缓存?如何禁用它?
PS:这个servlet是因为这个问题被张贴后我们通过电子邮件回答了它的G-WAN 4.3.14
我的代码是servlet。 – user2244023 2013-04-04 09:47:32
顺便说一下,每块之间的时间超过200毫秒! – user2244023 2013-04-04 09:58:55
这是微缓存问题。 – user2244023 2013-04-04 11:07:44