1
0
mirror of https://github.com/lxsang/ant-http synced 2024-07-03 13:39:46 +02:00
ant-http/http_server.h

46 lines
1.3 KiB
C
Raw Normal View History

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-02-09 13:13:11 +01:00
#include "libs/handle.h"
2015-10-22 11:39:11 +02:00
#include "plugin_manager.h"
2017-07-29 22:00:34 +02:00
#define FORM_URL_ENCODE "application/x-www-form-urlencoded"
#define FORM_MULTI_PART "multipart/form-data"
#define APP_JSON "application/json"
#define PLUGIN_HANDLER "handler"
#define WS_MAGIC_STRING "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
2015-10-22 11:39:11 +02:00
#define ISspace(x) isspace((int)(x))
2017-07-29 23:54:43 +02:00
#define SERVER_STRING "Server: ant-httpd"
2015-10-22 11:39:11 +02:00
void accept_request(int);
void cat(int, FILE *);
void cannot_execute(int);
void error_die(const char *);
int get_line(int, char *, int);
void not_found(int);
void serve_file(int, const char *);
int startup(unsigned *);
2017-07-29 22:00:34 +02:00
void unimplemented(int);
2018-02-03 18:50:07 +01:00
void badrequest(int);
void rule_check(association, const char* , const char* , const char* , char*);
2017-07-29 22:00:34 +02:00
void ws_confirm_request(int, const char*);
char* post_url_decode(int client,int len);
dictionary decode_url_request(const char* query);
dictionary decode_request(int client,const char* method, char* url);
2017-07-29 22:00:34 +02:00
dictionary decode_multi_part_request(int,const char*);
dictionary decode_cookie(const char*);
char* json_data_decode(int,int);
int execute_plugin(int client, const char *path,
const char *method, dictionary rq);
2017-07-30 01:00:36 +02:00
#endif