2017-07-30 01:00:36 +02:00
|
|
|
#ifndef HTTP_SERVER
|
|
|
|
#define HTTP_SERVER
|
2015-10-22 11:39:11 +02:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <signal.h>
|
2017-07-29 22:00:34 +02:00
|
|
|
#include <sys/socket.h>
|
2018-10-05 19:01:39 +02:00
|
|
|
#include <sys/select.h>
|
2018-02-09 13:13:11 +01:00
|
|
|
#include "libs/handle.h"
|
2018-10-04 19:47:31 +02:00
|
|
|
#include "libs/scheduler.h"
|
2015-10-22 11:39:11 +02:00
|
|
|
#include "plugin_manager.h"
|
|
|
|
|
2018-09-12 11:06:19 +02:00
|
|
|
#define PLUGIN_HANDLER "handle"
|
2017-07-29 22:00:34 +02:00
|
|
|
#define WS_MAGIC_STRING "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
2018-10-05 19:01:39 +02:00
|
|
|
#define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0
|
2018-02-10 11:22:41 +01:00
|
|
|
#define CONFIG "config.ini"
|
|
|
|
|
2018-10-05 19:01:39 +02:00
|
|
|
config_t* config();
|
|
|
|
void destroy_config();
|
2018-10-07 15:09:46 +02:00
|
|
|
void load_config(const char* file);
|
2018-10-04 19:47:31 +02:00
|
|
|
void* accept_request(void*);
|
2018-10-03 23:42:42 +02:00
|
|
|
void* finish_request(void*);
|
2018-02-10 11:22:41 +01:00
|
|
|
void cat(void*, FILE *);
|
|
|
|
void cannot_execute(void*);
|
2018-02-10 12:24:01 +01:00
|
|
|
//int get_line(int, char *, int);
|
2018-02-10 11:22:41 +01:00
|
|
|
void not_found(void*);
|
2018-10-04 19:47:31 +02:00
|
|
|
void* serve_file(void*);
|
2015-10-22 11:39:11 +02:00
|
|
|
int startup(unsigned *);
|
2018-02-10 11:22:41 +01:00
|
|
|
void unimplemented(void*);
|
|
|
|
void badrequest(void*);
|
2018-02-23 19:54:16 +01:00
|
|
|
int rule_check(const char*, const char*, const char* , const char* , const char* , char*);
|
2018-02-10 11:22:41 +01:00
|
|
|
void ws_confirm_request(void*, const char*);
|
|
|
|
char* post_url_decode(void* client,int len);
|
2018-09-05 23:26:21 +02:00
|
|
|
void decode_url_request(const char* query, dictionary);
|
2018-10-04 19:47:31 +02:00
|
|
|
void* decode_request_header(void* data);
|
|
|
|
void* decode_request(void* data);
|
|
|
|
void* decode_post_request(void* data);
|
|
|
|
void* resolve_request(void* data);
|
2018-10-07 15:09:46 +02:00
|
|
|
void* decode_multi_part_request(void*,const char*);
|
2018-10-05 19:01:39 +02:00
|
|
|
void* decode_multi_part_request_data(void* data);
|
2017-07-29 22:00:34 +02:00
|
|
|
dictionary decode_cookie(const char*);
|
2018-02-19 17:44:45 +01:00
|
|
|
char* post_data_decode(void*,int);
|
2018-10-05 19:01:39 +02:00
|
|
|
void set_nonblock(int);
|
2018-10-04 19:47:31 +02:00
|
|
|
void* execute_plugin(void* data, const char *path);
|
2017-07-30 01:00:36 +02:00
|
|
|
|
|
|
|
#endif
|