From d256051e0603c035eebbc153b5865663d74db8b9 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Sat, 27 Mar 2004 14:26:40 +0000 Subject: [PATCH] Fixed bug.(GET request detection) --- kagecgi/kagecgi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kagecgi/kagecgi.c b/kagecgi/kagecgi.c index 4a92461..b96e2bf 100755 --- a/kagecgi/kagecgi.c +++ b/kagecgi/kagecgi.c @@ -27,14 +27,16 @@ int main(int argc, char *argv[]){ //confirm request type = 0; - //argv - tmp1 = g_string_new((gchar *)argv[1]); - if(tmp1->len != 0) type = 1; - //direct + //GET request if(type == 0){ tmp1 = g_string_new((gchar *)getenv("QUERY_STRING")); if(tmp1->len != 0) type = 2; } + //argv(detect after GET request) + if(type == 0){ + tmp1 = g_string_new((gchar *)argv[1]); + if(tmp1->len != 0) type = 1; + } //redirect if(type == 0){ tmp1 = g_string_new((gchar *)getenv("REDIRECT_URL")); @@ -48,7 +50,7 @@ int main(int argc, char *argv[]){ pos = tmp1->str; //separate token - if(type == 1 || type == 2){ //argv or direct + if(type == 1 || type == 2){ //argv or GET request while(1){ cur = strchr(pos, '&'); tmp2 = g_string_new(pos); -- 1.7.10.4