亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
traffic server plugin 編譯及相關(guān)問題
[打印本頁]
作者:
qiucx
時(shí)間:
2012-10-14 15:53
標(biāo)題:
traffic server plugin 編譯及相關(guān)問題
1. 本人使用sdk3.2,ubuntu 10 Linux,想開發(fā)一個(gè)類似于example 里protocol組件的功能。 根據(jù)
http://trafficserver.apache.org/ ... mple-plugin.en.html
指南,用tsxs編譯的時(shí)候,出現(xiàn)如下錯(cuò)誤。thread主要適用example里的thread-pool里的代碼。查看錯(cuò)誤后,貌似無法編譯thrad.h里的typedef int (*ExecFunc) (TSCont, void *);句子。不知道如何解決這個(gè)問題?請指教!謝謝
tc@ubuntu:/usr/compile$ tsxs -o ctxplugin.so -c thread.h thread.c content_plugin.h content_plugin.c
compiling thread.h -> thread.lo
thread.h:36: error: expected ‘)’ before ‘void’
thread.h:42: error: expected specifier-qualifier-list before ‘TSCont’
thread.h:62: error: expected specifier-qualifier-list before ‘TSMutex’
thread.h:77: error: expected ‘)’ before ‘contp’
Compile failed: gcc -I/usr/local/include -march=i586 -g -pipe -Wall -Werror -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -fpic -c thread.h -o thread.lo
tc@ubuntu:/usr/compile$
2. 對于分析http頭,本人的代碼如下,但貌似不很專業(yè),兄是否有更好的解決方案:
void parse_request(char * request_data, CustomRequest * request) ////////////// general ok
{
TSDebug("protocol", "Entering parse_request");
char *token = NULL;
token = strtok(request_data, "\r\n");
while (token)
{
char * g = strstr(token, "GET");
if (g != NULL)
{
char* get = strstr(g, "/");
char ret[40];
get++;
strncpy ( ret, get, strlen(get)-9 );
ret[strlen(get)-9] = '\0';
request->transfer_id = ret;
}
char * pch = strstr(token, "Ingress-Capacity");
if (pch != NULL)
{
char* ret = strstr(pch, ":");
ret ++ ;
request->ingress_capacity = 0;//num;
}
char * r = strstr(token, "Range");
if (r != NULL)
{
char* ret = strstr(r, "=");
ret ++;
request->range = ret;
}
token = strtok(NULL, "\r\n");
}
TSDebug("protocol", "Exit parse_request");
}
3. 為了測試,需要建立一個(gè)server以檢測plugin功能正常,目前計(jì)劃用java實(shí)現(xiàn),如果方便的話,兄是否有類似解決方案供參考一下。
作者:
aaaaaa
時(shí)間:
2012-10-14 22:18
回復(fù)
1#
qiucx
你的問題都是我不擅長的唉。這個(gè)問題有點(diǎn)麻煩啦。bbs的消息,讀了就找不到了,是不是你發(fā)的?我的新浪微薄 @ming_zym 可私信聯(lián)系。
歡迎光臨 Chinaunix (http://www.72891.cn/)
Powered by Discuz! X3.2