diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-29 23:33:09 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-29 23:33:09 +0300 |
commit | 676f6520bf76867135f1af4fab5d69b3b212d198 (patch) | |
tree | ba068a6f93595c8a97c8b99c3aa11883d95b136a /examples | |
parent | b08db17162fddda97e6ee1ac625eae1430d22b64 (diff) | |
download | magi-676f6520bf76867135f1af4fab5d69b3b212d198.tar magi-676f6520bf76867135f1af4fab5d69b3b212d198.tar.xz magi-676f6520bf76867135f1af4fab5d69b3b212d198.zip |
[magi] Finally done. (Probably. =) )
Diffstat (limited to 'examples')
-rw-r--r-- | examples/append.c | 2 | ||||
-rw-r--r-- | examples/cookie.c | 2 | ||||
-rw-r--r-- | examples/echo.c | 2 | ||||
-rw-r--r-- | examples/fcgi.c | 3 | ||||
-rw-r--r-- | examples/upload.c | 4 |
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); |