From: Jeremy Tan Date: Thu, 15 Aug 2013 13:26:47 +0000 (+0800) Subject: fix redundant code, add makefile and example webpage X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=d75166147014e75d49f066983740e42902a38e90;p=matches%2FMCTX3420.git fix redundant code, add makefile and example webpage --- diff --git a/testing/fastcgi-approach/Makefile b/testing/fastcgi-approach/Makefile new file mode 100644 index 0000000..03be42f --- /dev/null +++ b/testing/fastcgi-approach/Makefile @@ -0,0 +1,22 @@ +CXX = gcc +FLAGS = -std=c99 -Wall -Werror -pedantic -g +LIB = -lpthread -lfcgi +OBJ = fastcgi.o +RM = rm -f + +BIN = fast + +$(BIN) : $(OBJ) + $(CXX) $(FLAGS) -o $(BIN) $(OBJ) $(LIB) + +%.o : %.c + $(CXX) $(FLAGS) -c $< + +clean: + $(RM) $(BIN) + $(RM) *.o + +clean_full: #cleans up all backup files + $(RM) $(BIN) $(OBJ) $(LINKOBJ) + $(RM) *.*~ + $(RM) *~ diff --git a/testing/fastcgi-approach/fastcgi.c b/testing/fastcgi-approach/fastcgi.c index e4b5adb..8ade3f2 100644 --- a/testing/fastcgi-approach/fastcgi.c +++ b/testing/fastcgi-approach/fastcgi.c @@ -51,7 +51,7 @@ static char *KeyPair(char *in, const char **key, const char **value) { } //Split was not found, set to default value *value = ""; - return next ? next : ""; + return next; } static void BeginResponse(int response_code, const char *module) { diff --git a/testing/fastcgi-approach/index.html b/testing/fastcgi-approach/index.html new file mode 100644 index 0000000..a3ff3ec --- /dev/null +++ b/testing/fastcgi-approach/index.html @@ -0,0 +1,82 @@ + + + + + + FastCGI API Test + + + + + + +

FastCGI API Test

+ The API is located at: http://mctx.us.to:8080/api/
+

Input

+ Place a query string here. Examples include:
+ + Response times are inaccurate via JavaScript. Use the web console of + your browser to determine how long the query takes.
+ Hopefully this doesn't break! +
+
+ Query string:
+ +
+
+ +

Output

+
+
+ +