summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/mongoose/examples/digest_authentication/digest_auth.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-11-04 18:55:36 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-11-04 18:55:36 +0100
commitb6707c3bb53c931e9ec3c5c6630149b7121bbcf5 (patch)
tree2d9c880bb21242c3fb4619977fe9a71658b3d06e /3rdparty/mongoose/examples/digest_authentication/digest_auth.c
parent2a067f08a4582cdff841dc27b661a9e48fac419a (diff)
Removed mongoose due to restricted license and webserver wip till code is restructured (nw)
Diffstat (limited to '3rdparty/mongoose/examples/digest_authentication/digest_auth.c')
-rw-r--r--3rdparty/mongoose/examples/digest_authentication/digest_auth.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/3rdparty/mongoose/examples/digest_authentication/digest_auth.c b/3rdparty/mongoose/examples/digest_authentication/digest_auth.c
deleted file mode 100644
index 18835c729c7..00000000000
--- a/3rdparty/mongoose/examples/digest_authentication/digest_auth.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include "mongoose.h"
-
-static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
-
- if (ev == MG_AUTH) {
- int result = MG_FALSE; // Not authorized
- FILE *fp;
-
- // To populate passwords file, do
- // mongoose -A my_passwords.txt mydomain.com admin admin
- if ((fp = fopen("my_passwords.txt", "r")) != NULL) {
- result = mg_authorize_digest(conn, fp);
- fclose(fp);
- }
-
- return result;
- }
-
- return MG_FALSE;
-}
-
-int main(void) {
- struct mg_server *server = mg_create_server(NULL, ev_handler);
- mg_set_option(server, "listening_port", "8080");
- mg_set_option(server, "document_root", ".");
-
- printf("Starting on port %s\n", mg_get_option(server, "listening_port"));
- for (;;) {
- mg_poll_server(server, 1000);
- }
- mg_destroy_server(&server);
-
- return 0;
-}