From d75166147014e75d49f066983740e42902a38e90 Mon Sep 17 00:00:00 2001 From: Jeremy Tan Date: Thu, 15 Aug 2013 21:26:47 +0800 Subject: [PATCH] fix redundant code, add makefile and example webpage --- testing/fastcgi-approach/Makefile | 22 ++++++++ testing/fastcgi-approach/fastcgi.c | 2 +- testing/fastcgi-approach/index.html | 82 +++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 testing/fastcgi-approach/Makefile create mode 100644 testing/fastcgi-approach/index.html 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

+
+
+ + -- 2.20.1