Rev 4163 | Rev 4168 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4163 | hidnplayr | 1 | //HTTP library |
2 | |||
4165 | hidnplayr | 3 | dword libHTTP = #alibHTTP; |
4 | char alibHTTP[23] = "/sys/lib/http.obj\0"; |
||
5 | |||
4163 | hidnplayr | 6 | dword http_lib_init = #aLib_init; |
7 | dword http_get = #aHTTPget; |
||
8 | dword http_process = #aHTTPprocess; |
||
9 | $DD 2 dup 0 |
||
10 | |||
11 | char aLib_init[9] = "lib_init\0"; |
||
12 | char aHTTPget[4] = "get\0"; |
||
13 | char aHTTPprocess[8] = "process\0"; |
||
14 | |||
15 | #define FLAG_HTTP11 1 << 0 |
||
16 | #define FLAG_GOT_HEADER 1 << 1 |
||
17 | #define FLAG_GOT_DATA 1 << 2 |
||
18 | #define FLAG_CONTENT_LENGTH 1 << 3 |
||
19 | #define FLAG_CHUNKED 1 << 4 |
||
20 | |||
4165 | hidnplayr | 21 | // error flags go into the upper word |
4163 | hidnplayr | 22 | #define FLAG_INVALID_HEADER 1 << 16 |
23 | #define FLAG_NO_RAM 1 << 17 |
||
24 | #define FLAG_SOCKET_ERROR 1 << 18 |
||
25 | |||
26 | struct http_msg{ |
||
27 | dword socket; |
||
28 | dword flags; |
||
29 | dword write_ptr; |
||
30 | dword buffer_length; |
||
31 | dword chunk_ptr; |
||
32 | |||
33 | dword status; |
||
34 | dword header_length; |
||
35 | dword content_length; |
||
4165 | hidnplayr | 36 | char data; |
4163 | hidnplayr | 37 | };><>><>><>><>><>><>><>><> |