#include "server.h"
#include <chrono>
#include <condition_variable>
#include <cstdio>
#include <mutex>
#include <sstream>
#include <thread>
#include "mongoose.h"
#include <time.h>
Go to the source code of this file.
Defines | |
#define | SERVER_PORT "8080" |
Functions | |
std::string | base64_decode (std::string const &encoded_string) |
static int | basicAuth (struct mg_connection *conn) |
static int | basicCookies (struct mg_connection *conn) |
static int | basicJson (struct mg_connection *conn) |
static int | checkBasicCookies (struct mg_connection *conn) |
static int | checkV1Cookies (struct mg_connection *conn) |
static int | deleteRequest (struct mg_connection *conn) |
static int | deleteUnallowedRequest (struct mg_connection *conn) |
static int | digestAuth (struct mg_connection *conn) |
static int | evHandler (struct mg_connection *conn, enum mg_event ev) |
static int | formPost (struct mg_connection *conn) |
static int | headerReflect (struct mg_connection *conn) |
static int | hello (struct mg_connection *conn) |
static bool | is_base64 (unsigned char c) |
static int | jsonPost (struct mg_connection *conn) |
static int | lowercase (const char *s) |
static int | lowSpeed (struct mg_connection *conn) |
static int | lowSpeedBytes (struct mg_connection *conn) |
static int | mg_strncasecmp (const char *s1, const char *s2, size_t len) |
static int | options (struct mg_connection *conn) |
static int | patch (struct mg_connection *conn) |
static int | patchUnallowed (struct mg_connection *conn) |
static int | permanentRedirect (struct mg_connection *conn) |
static int | put (struct mg_connection *conn) |
static int | putUnallowed (struct mg_connection *conn) |
void | runServer (struct mg_server *server) |
static int | temporaryRedirect (struct mg_connection *conn) |
static int | timeout (struct mg_connection *conn) |
static int | twoRedirects (struct mg_connection *conn) |
static int | urlPost (struct mg_connection *conn) |
static int | v1Cookies (struct mg_connection *conn) |
Variables | |
static const std::string | base64_chars = "0123456789+/" |
std::condition_variable | server_cv |
std::mutex | server_mutex |
std::mutex | shutdown_mutex |
#define SERVER_PORT "8080" |
Definition at line 14 of file server.cpp.
std::string base64_decode | ( | std::string const & | encoded_string | ) |
Definition at line 619 of file server.cpp.
static int basicAuth | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 163 of file server.cpp.
static int basicCookies | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 97 of file server.cpp.
static int basicJson | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 206 of file server.cpp.
static int checkBasicCookies | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 128 of file server.cpp.
static int checkV1Cookies | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 146 of file server.cpp.
static int deleteRequest | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 365 of file server.cpp.
static int deleteUnallowedRequest | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 396 of file server.cpp.
static int digestAuth | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 185 of file server.cpp.
static int evHandler | ( | struct mg_connection * | conn, |
enum mg_event | ev | ||
) | [static] |
Definition at line 509 of file server.cpp.
static int formPost | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 322 of file server.cpp.
static int headerReflect | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 228 of file server.cpp.
static int hello | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 49 of file server.cpp.
Definition at line 615 of file server.cpp.
static int jsonPost | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 298 of file server.cpp.
static int lowercase | ( | const char * | s | ) | [static] |
Definition at line 667 of file server.cpp.
static int lowSpeed | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 77 of file server.cpp.
static int lowSpeedBytes | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 86 of file server.cpp.
static int mg_strncasecmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | len | ||
) | [static] |
Definition at line 671 of file server.cpp.
static int options | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 30 of file server.cpp.
static int patch | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 411 of file server.cpp.
static int patchUnallowed | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 445 of file server.cpp.
static int permanentRedirect | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 255 of file server.cpp.
static int put | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 460 of file server.cpp.
static int putUnallowed | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 494 of file server.cpp.
Definition at line 576 of file server.cpp.
static int temporaryRedirect | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 247 of file server.cpp.
static int timeout | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 68 of file server.cpp.
static int twoRedirects | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 263 of file server.cpp.
static int urlPost | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 271 of file server.cpp.
static int v1Cookies | ( | struct mg_connection * | conn | ) | [static] |
Definition at line 113 of file server.cpp.
const std::string base64_chars = "0123456789+/" [static] |
Definition at line 21 of file server.cpp.
std::condition_variable server_cv |
Definition at line 19 of file server.cpp.
Definition at line 18 of file server.cpp.
Definition at line 17 of file server.cpp.