2020-08-16 07:58:53 +08:00
|
|
|
#ifndef HTTP_REQUEST_H
|
|
|
|
#define HTTP_REQUEST_H
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <regex.h>
|
2020-07-30 18:10:31 +08:00
|
|
|
#include "http_proxy.h"
|
2020-01-21 19:48:05 +08:00
|
|
|
#include "conf.h"
|
2020-07-30 18:10:31 +08:00
|
|
|
|
|
|
|
struct http_request {
|
2021-07-20 22:17:06 +08:00
|
|
|
char *method, *U, *version;
|
2020-08-16 07:58:53 +08:00
|
|
|
char *host, *port, *H;
|
|
|
|
char *url, *uri;
|
|
|
|
|
2021-07-20 22:17:06 +08:00
|
|
|
int method_len, U_len, version_len;
|
2020-08-16 07:58:53 +08:00
|
|
|
int host_len, port_len, H_len;
|
|
|
|
int url_len, uri_len;
|
2020-07-30 18:10:31 +08:00
|
|
|
};
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen);
|
2021-07-20 22:17:06 +08:00
|
|
|
extern char *replace(char *replace_memory, int *replace_memory_len, const char *src, const int src_len, const char *dest, const int dest_len);
|
2020-11-26 17:40:17 +08:00
|
|
|
char *request_head(conn_t * in, conf * configure);
|
2021-07-20 22:17:06 +08:00
|
|
|
extern int8_t copy_new_mem(char *src, int src_len, char **dest);
|
2021-12-23 09:02:41 +08:00
|
|
|
extern void errors(const char *msg);
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#endif
|