#include "server_setup.h"
#include "curlx.h"
#include "getpart.h"
#include "inet_pton.h"
#include "util.h"
#include "server_sockaddr.h"
#include "memdebug.h"
Go to the source code of this file.
|
static curl_socket_t | accept_connection (curl_socket_t sock) |
|
static curl_socket_t | connect_to (const char *ipaddr, unsigned short port) |
|
static RETSIGTYPE | exit_signal_handler (int signum) |
|
static int | get_request (curl_socket_t sock, struct httprequest *req) |
|
static void | http2 (struct httprequest *req) |
|
static void | http_connect (curl_socket_t *infdp, curl_socket_t rootfd, const char *ipaddr, unsigned short ipport) |
|
static void | init_httprequest (struct httprequest *req) |
|
static void | install_signal_handlers (void) |
|
int | main (int argc, char *argv[]) |
|
static int | parse_servercmd (struct httprequest *req) |
|
static int | ProcessRequest (struct httprequest *req) |
|
static void | restore_signal_handlers (void) |
|
static int | send_doc (curl_socket_t sock, struct httprequest *req) |
|
static int | service_connection (curl_socket_t msgsock, struct httprequest *req, curl_socket_t listensock, const char *connecthost) |
|
static bool | socket_domain_is_ip (void) |
|
static void | storerequest (const char *reqbuf, size_t totalsize) |
|
#define CMD_AUTH_REQUIRED "auth_required" |
#define CMD_CONNECTIONMONITOR "connection-monitor" |
#define CMD_STREAM "stream" |
#define CMD_UPGRADE "upgrade" |
#define data_or_ctrl |
( |
|
x | ) |
((x)?"DATA":"CTRL") |
#define DEFAULT_LOGFILE "log/sws.log" |
#define DEFAULT_PORT 8999 |
#define ENABLE_CURLX_PRINTF |
Definition at line 47 of file sws.c.
#define END_OF_HEADERS "\r\n\r\n" |
#define MAXDOCNAMELEN 140000 |
#define MAXDOCNAMELEN_TXT "139999" |
#define RCMD_IDLE 1 /* told to sit idle */ |
Definition at line 91 of file sws.c.
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ |
Definition at line 90 of file sws.c.
#define RCMD_STREAM 2 /* told to stream */ |
Definition at line 92 of file sws.c.
Definition at line 81 of file sws.c.
#define REQBUFSIZ_TXT "149999" |
Definition at line 82 of file sws.c.
#define REQUEST_DUMP "log/server.input" |
#define REQUEST_KEYWORD_SIZE 256 |
#define REQUEST_KEYWORD_SIZE_TXT "255" |
#define REQUEST_PROXY_DUMP "log/proxy.input" |
#define RESPONSE_DUMP "log/server.response" |
#define RESPONSE_PROXY_DUMP "log/proxy.response" |
#define siginterrupt |
( |
|
x, |
|
|
|
y |
|
) |
| do {} while(0) |
#define STREAMTHIS "a string to stream 01234567890\n" |
Enumerator |
---|
socket_domain_inet |
|
Definition at line 68 of file sws.c.
Enumerator |
---|
DOCNUMBER_NOTHING |
|
DOCNUMBER_QUIT |
|
DOCNUMBER_WERULEZ |
|
DOCNUMBER_404 |
|
Definition at line 179 of file sws.c.
static curl_socket_t connect_to |
( |
const char * |
ipaddr, |
|
|
unsigned short |
port |
|
) |
| |
|
static |
static RETSIGTYPE exit_signal_handler |
( |
int |
signum | ) |
|
|
static |
static void init_httprequest |
( |
struct httprequest * |
req | ) |
|
|
static |
static void install_signal_handlers |
( |
void |
| ) |
|
|
static |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
static void restore_signal_handlers |
( |
void |
| ) |
|
|
static |
static bool socket_domain_is_ip |
( |
void |
| ) |
|
|
static |
static void storerequest |
( |
const char * |
reqbuf, |
|
|
size_t |
totalsize |
|
) |
| |
|
static |
Initial value:= "HTTP/1.1 404 Not Found\r\n"
"Connection: close\r\n"
"Content-Type: text/html"
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n"
Definition at line 193 of file sws.c.
Initial value:
Definition at line 189 of file sws.c.
volatile int exit_signal = 0 |
|
static |
Definition at line 79 of file sws.c.
Definition at line 86 of file sws.c.
Definition at line 85 of file sws.c.
Definition at line 84 of file sws.c.
Definition at line 78 of file sws.c.
enum { ... } socket_domain |
Definition at line 77 of file sws.c.