Rev | Line | |
---|
[16] | 1 | /* $Id: tw_http.h 140 2024-09-23 11:31:18Z nishi $ */
|
---|
| 2 |
|
---|
| 3 | #ifndef __TW_HTTP_H__
|
---|
| 4 | #define __TW_HTTP_H__
|
---|
| 5 |
|
---|
[140] | 6 | #ifdef __cplusplus
|
---|
| 7 | extern "C" {
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
[20] | 10 | #include <stdbool.h>
|
---|
| 11 |
|
---|
[43] | 12 | #include "../config.h"
|
---|
| 13 |
|
---|
[16] | 14 | struct tw_http_request {
|
---|
| 15 | char* method;
|
---|
| 16 | char* path;
|
---|
[20] | 17 | char* query;
|
---|
[16] | 18 | char* version;
|
---|
| 19 | char** headers;
|
---|
| 20 | char* body;
|
---|
| 21 | };
|
---|
| 22 |
|
---|
| 23 | struct tw_http_response {
|
---|
| 24 | char** headers;
|
---|
[20] | 25 | int status;
|
---|
| 26 | bool _processed; /* Internal parameter */
|
---|
[16] | 27 | };
|
---|
| 28 |
|
---|
| 29 | #ifdef SOURCE
|
---|
[43] | 30 | #ifndef NO_SSL
|
---|
[16] | 31 | #include <openssl/ssl.h>
|
---|
[43] | 32 | #endif
|
---|
[32] | 33 | void tw_free_request(struct tw_http_request* req);
|
---|
[43] | 34 | #ifndef NO_SSL
|
---|
[16] | 35 | int tw_http_parse(SSL* ssl, int sock, struct tw_http_request* req);
|
---|
[43] | 36 | #else
|
---|
| 37 | int tw_http_parse(void* ssl, int sock, struct tw_http_request* req);
|
---|
[16] | 38 | #endif
|
---|
[43] | 39 | #endif
|
---|
[16] | 40 |
|
---|
[140] | 41 | #ifdef __cplusplus
|
---|
| 42 | }
|
---|
[16] | 43 | #endif
|
---|
[140] | 44 |
|
---|
| 45 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.