Rev 6005 | Rev 7283 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5598 | pavelyakov | 1 | #ifndef INCLUDE_LIBHTTP_H |
2 | #define INCLUDE_LIBHTTP_H |
||
4163 | hidnplayr | 3 | |
5598 | pavelyakov | 4 | #ifndef INCLUDE_KOLIBRI_H |
5 | #include "../lib/kolibri.h" |
||
6 | #endif |
||
7 | |||
8 | #ifndef INCLUDE_DLL_H |
||
9 | #include "../lib/dll.h" |
||
10 | #endif |
||
11 | |||
4165 | hidnplayr | 12 | dword libHTTP = #alibHTTP; |
6005 | leency | 13 | char alibHTTP[] = "/sys/lib/http.obj"; |
4165 | hidnplayr | 14 | |
5576 | pavelyakov | 15 | dword http_lib_init = #aLib_init; |
16 | dword http_get = #aHTTPget; |
||
17 | dword http_head = #aHTTPhead; |
||
18 | dword http_post = #aHTTPpost; |
||
4235 | leency | 19 | dword http_find_header_field = #aFHF; |
5576 | pavelyakov | 20 | dword http_send = #aHTTPsend; |
21 | dword http_receive = #aHTTPreceive; |
||
22 | dword http_disconnect = #aHTTPdisconnect; |
||
23 | dword http_free = #aHTTPfree; |
||
24 | dword uri_escape = #aURIescape; |
||
25 | dword uri_unescape = #aURIunescape; |
||
4163 | hidnplayr | 26 | $DD 2 dup 0 |
27 | |||
6005 | leency | 28 | char aLib_init[] = "lib_init"; |
29 | char aHTTPget[] = "get"; |
||
30 | char aHTTPhead[] = "head"; |
||
31 | char aHTTPpost[] = "post"; |
||
32 | char aFHF[] = "find_header_field"; |
||
33 | char aHTTPsend[] = "send"; |
||
34 | char aHTTPreceive[] = "receive"; |
||
35 | char aHTTPdisconnect[] = "disconnect"; |
||
36 | char aHTTPfree[] = "free"; |
||
37 | char aURIescape[] = "escape"; |
||
38 | char aURIunescape[] = "unescape"; |
||
4163 | hidnplayr | 39 | |
5534 | hidnplayr | 40 | // status flags |
4163 | hidnplayr | 41 | #define FLAG_HTTP11 1 << 0 |
42 | #define FLAG_GOT_HEADER 1 << 1 |
||
4536 | leency | 43 | #define FLAG_GOT_ALL_DATA 1 << 2 |
4163 | hidnplayr | 44 | #define FLAG_CONTENT_LENGTH 1 << 3 |
45 | #define FLAG_CHUNKED 1 << 4 |
||
4235 | leency | 46 | #define FLAG_CONNECTED 1 << 5 |
4163 | hidnplayr | 47 | |
5534 | hidnplayr | 48 | // user flags |
49 | #define FLAG_KEEPALIVE 1 << 8 |
||
6001 | leency | 50 | #define FLAG_MULTIBUFF 1 << 9 |
5534 | hidnplayr | 51 | |
52 | // error flags |
||
4163 | hidnplayr | 53 | #define FLAG_INVALID_HEADER 1 << 16 |
54 | #define FLAG_NO_RAM 1 << 17 |
||
55 | #define FLAG_SOCKET_ERROR 1 << 18 |
||
4235 | leency | 56 | #define FLAG_TIMEOUT_ERROR 1 << 19 |
4536 | leency | 57 | #define FLAG_TRANSFER_FAILED 1 << 20 |
4163 | hidnplayr | 58 | |
59 | struct http_msg{ |
||
60 | dword socket; |
||
61 | dword flags; |
||
62 | dword write_ptr; |
||
63 | dword buffer_length; |
||
64 | dword chunk_ptr; |
||
4235 | leency | 65 | dword timestamp; |
4163 | hidnplayr | 66 | dword status; |
67 | dword header_length; |
||
6005 | leency | 68 | dword content_ptr; |
4163 | hidnplayr | 69 | dword content_length; |
4168 | hidnplayr | 70 | dword content_received; |
4536 | leency | 71 | char http_header; |
5576 | pavelyakov | 72 | }; |
73 | |||
5598 | pavelyakov | 74 | |
75 | #endif><>><>><>><>><>><>><>><>><>><>><>><>><> |