aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/append.c2
-rw-r--r--examples/cookie.c2
-rw-r--r--examples/echo.c2
-rw-r--r--examples/fcgi.c3
-rw-r--r--examples/upload.c4
5 files changed, 7 insertions, 6 deletions
diff --git a/examples/append.c b/examples/append.c
index e6e4a8a..cb49e50 100644
--- a/examples/append.c
+++ b/examples/append.c
@@ -34,7 +34,7 @@ int main(int argc, char const * argv[])
{
struct magi_request request;
magi_request_setup(&request);
- if (magi_request_cgi(&request)) {
+ if (magi_request_cgi(&request) && magi_request_resume_cgi(&request)) {
struct magi_response response;
magi_response_setup(&response);
response_request(&request, &response);
diff --git a/examples/cookie.c b/examples/cookie.c
index f21cb4a..bb1e1d1 100644
--- a/examples/cookie.c
+++ b/examples/cookie.c
@@ -32,7 +32,7 @@ int main(int argc, char const * argv[])
{
struct magi_request request;
magi_request_setup(&request);
- if (magi_request_cgi(&request)) {
+ if (magi_request_cgi(&request) && magi_request_resume_cgi(&request)) {
struct magi_response response;
magi_response_setup(&response);
response_request(&request, &response);
diff --git a/examples/echo.c b/examples/echo.c
index 3f72f8a..e9807f0 100644
--- a/examples/echo.c
+++ b/examples/echo.c
@@ -113,7 +113,7 @@ int main(int argc, char const * argv[])
{
struct magi_request request;
magi_request_setup(&request);
- if (magi_request_cgi(&request)) {
+ if (magi_request_cgi(&request) && magi_request_resume_cgi(&request)) {
struct magi_response response;
magi_response_setup(&response);
response_request(&request, &response);
diff --git a/examples/fcgi.c b/examples/fcgi.c
index 06384c4..2790f9d 100644
--- a/examples/fcgi.c
+++ b/examples/fcgi.c
@@ -27,7 +27,8 @@ int main(int argc, char const * argv[])
if (magi_session_fcgi(&session, sock)) {
struct magi_request request;
magi_request_setup(&request);
- while (magi_request_fcgi(&request, &session)) {
+ while (magi_request_fcgi(&request, &session) &&
+ magi_request_resume_fcgi(&request, &session)) {
if (!request.error) {
struct magi_response response;
magi_response_setup(&response);
diff --git a/examples/upload.c b/examples/upload.c
index f4350ee..1947f93 100644
--- a/examples/upload.c
+++ b/examples/upload.c
@@ -22,7 +22,7 @@ void response_request(struct magi_request * req, struct magi_response * res)
"<html xmlns='http://www.w3.org/1999/xhtml'>"
"<head><title>Upload File</title></head>"
"<body>"
- "<form action='/cgi-bin/echo' method='post' "
+ "<form action='/cgi-bin/upload' method='post' "
"enctype='multipart/form-data'><fieldset>"
"<input type='text' name='name' value='filename'/>"
"<input type='file' name='data'/>"
@@ -39,7 +39,7 @@ int main(int argc, char const * argv[])
magi_request_setup(&request);
magi_tempfiles_add(&tmps, "data", "data", 0);
magi_request_setup_tempfiles(&request, &tmps);
- if (magi_request_cgi(&request)) {
+ if (magi_request_cgi(&request) && magi_request_resume_cgi(&request)) {
struct magi_response response;
magi_response_setup(&response);
response_request(&request, &response);