Subversion Repositories Tewi

Rev

Rev 32 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 nishi 1
/* $Id: tw_http.h 43 2024-09-18 09:19:03Z nishi $ */
2
 
3
#ifndef __TW_HTTP_H__
4
#define __TW_HTTP_H__
5
 
20 nishi 6
#include <stdbool.h>
7
 
43 nishi 8
#include "../config.h"
9
 
16 nishi 10
struct tw_http_request {
11
	char* method;
12
	char* path;
20 nishi 13
	char* query;
16 nishi 14
	char* version;
15
	char** headers;
16
	char* body;
17
};
18
 
19
struct tw_http_response {
20
	char** headers;
20 nishi 21
	int status;
22
	bool _processed; /* Internal parameter */
16 nishi 23
};
24
 
25
#ifdef SOURCE
43 nishi 26
#ifndef NO_SSL
16 nishi 27
#include <openssl/ssl.h>
43 nishi 28
#endif
32 nishi 29
void tw_free_request(struct tw_http_request* req);
43 nishi 30
#ifndef NO_SSL
16 nishi 31
int tw_http_parse(SSL* ssl, int sock, struct tw_http_request* req);
43 nishi 32
#else
33
int tw_http_parse(void* ssl, int sock, struct tw_http_request* req);
16 nishi 34
#endif
43 nishi 35
#endif
16 nishi 36
 
37
#endif