Rev | Line | |
---|
[16] | 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] | 6 | #include <stdbool.h>
|
---|
| 7 |
|
---|
[43] | 8 | #include "../config.h"
|
---|
| 9 |
|
---|
[16] | 10 | struct tw_http_request {
|
---|
| 11 | char* method;
|
---|
| 12 | char* path;
|
---|
[20] | 13 | char* query;
|
---|
[16] | 14 | char* version;
|
---|
| 15 | char** headers;
|
---|
| 16 | char* body;
|
---|
| 17 | };
|
---|
| 18 |
|
---|
| 19 | struct tw_http_response {
|
---|
| 20 | char** headers;
|
---|
[20] | 21 | int status;
|
---|
| 22 | bool _processed; /* Internal parameter */
|
---|
[16] | 23 | };
|
---|
| 24 |
|
---|
| 25 | #ifdef SOURCE
|
---|
[43] | 26 | #ifndef NO_SSL
|
---|
[16] | 27 | #include <openssl/ssl.h>
|
---|
[43] | 28 | #endif
|
---|
[32] | 29 | void tw_free_request(struct tw_http_request* req);
|
---|
[43] | 30 | #ifndef NO_SSL
|
---|
[16] | 31 | int tw_http_parse(SSL* ssl, int sock, struct tw_http_request* req);
|
---|
[43] | 32 | #else
|
---|
| 33 | int tw_http_parse(void* ssl, int sock, struct tw_http_request* req);
|
---|
[16] | 34 | #endif
|
---|
[43] | 35 | #endif
|
---|
[16] | 36 |
|
---|
| 37 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.