#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) |
|
◆ CMD_AUTH_REQUIRED
#define CMD_AUTH_REQUIRED "auth_required" |
◆ CMD_CONNECTIONMONITOR
#define CMD_CONNECTIONMONITOR "connection-monitor" |
◆ CMD_IDLE
◆ CMD_STREAM
#define CMD_STREAM "stream" |
◆ CMD_UPGRADE
#define CMD_UPGRADE "upgrade" |
◆ CTRL
◆ DATA
◆ data_or_ctrl
#define data_or_ctrl |
( |
|
x | ) |
((x)?"DATA":"CTRL") |
◆ DEFAULT_LOGFILE
#define DEFAULT_LOGFILE "log/sws.log" |
◆ DEFAULT_PORT
#define DEFAULT_PORT 8999 |
◆ ENABLE_CURLX_PRINTF
#define ENABLE_CURLX_PRINTF |
Definition at line 47 of file sws.c.
◆ END_OF_HEADERS
#define END_OF_HEADERS "\r\n\r\n" |
◆ MAX_SOCKETS
◆ MAXDOCNAMELEN
#define MAXDOCNAMELEN 140000 |
◆ MAXDOCNAMELEN_TXT
#define MAXDOCNAMELEN_TXT "139999" |
◆ RCMD_IDLE
#define RCMD_IDLE 1 /* told to sit idle */ |
Definition at line 91 of file sws.c.
◆ RCMD_NORMALREQ
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ |
Definition at line 90 of file sws.c.
◆ RCMD_STREAM
#define RCMD_STREAM 2 /* told to stream */ |
Definition at line 92 of file sws.c.
◆ REQBUFSIZ
Definition at line 81 of file sws.c.
◆ REQBUFSIZ_TXT
#define REQBUFSIZ_TXT "149999" |
Definition at line 82 of file sws.c.
◆ REQUEST_DUMP
#define REQUEST_DUMP "log/server.input" |
◆ REQUEST_KEYWORD_SIZE
#define REQUEST_KEYWORD_SIZE 256 |
◆ REQUEST_KEYWORD_SIZE_TXT
#define REQUEST_KEYWORD_SIZE_TXT "255" |
◆ REQUEST_PROXY_DUMP
#define REQUEST_PROXY_DUMP "log/proxy.input" |
◆ RESPONSE_DUMP
◆ RESPONSE_PROXY_DUMP
◆ siginterrupt
#define siginterrupt |
( |
|
x, |
|
|
|
y |
|
) |
| do {} while(0) |
◆ STREAMTHIS
#define STREAMTHIS "a string to stream 01234567890\n" |
◆ SWSVERSION
◆ SIGHANDLER_T
◆ anonymous enum
Enumerator |
---|
socket_domain_inet | |
Definition at line 68 of file sws.c.
◆ anonymous enum
Enumerator |
---|
DOCNUMBER_NOTHING | |
DOCNUMBER_QUIT | |
DOCNUMBER_WERULEZ | |
DOCNUMBER_404 | |
Definition at line 179 of file sws.c.
◆ accept_connection()
◆ connect_to()
static curl_socket_t connect_to |
( |
const char * |
ipaddr, |
|
|
unsigned short |
port |
|
) |
| |
|
static |
◆ exit_signal_handler()
static RETSIGTYPE exit_signal_handler |
( |
int |
signum | ) |
|
|
static |
◆ get_request()
◆ http2()
◆ http_connect()
◆ init_httprequest()
static void init_httprequest |
( |
struct httprequest * |
req | ) |
|
|
static |
◆ install_signal_handlers()
static void install_signal_handlers |
( |
void |
| ) |
|
|
static |
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ parse_servercmd()
◆ ProcessRequest()
◆ restore_signal_handlers()
static void restore_signal_handlers |
( |
void |
| ) |
|
|
static |
◆ send_doc()
◆ service_connection()
◆ socket_domain_is_ip()
static bool socket_domain_is_ip |
( |
void |
| ) |
|
|
static |
◆ storerequest()
static void storerequest |
( |
const char * |
reqbuf, |
|
|
size_t |
totalsize |
|
) |
| |
|
static |
◆ all_sockets
◆ doc404
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.
◆ docquit
Initial value:
Definition at line 189 of file sws.c.
◆ end_of_headers
◆ exit_signal
volatile int exit_signal = 0 |
|
static |
◆ got_exit_signal
◆ is_proxy
Definition at line 79 of file sws.c.
◆ num_sockets
◆ prevbounce
Definition at line 86 of file sws.c.
◆ prevpartno
Definition at line 85 of file sws.c.
◆ prevtestno
Definition at line 84 of file sws.c.
◆ serverlogfile
◆ serverlogslocked
Definition at line 78 of file sws.c.
◆ socket_domain
enum { ... } socket_domain |
◆ use_gopher
Definition at line 77 of file sws.c.