Subversion Repositories Kolibri OS

Rev

Rev 4235 | 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;
4235 leency 8
dword http_head           = #aHTTPhead;
9
dword http_post           = #aHTTPpost;
10
dword http_find_header_field = #aFHF;
4163 hidnplayr 11
dword http_process        = #aHTTPprocess;
4235 leency 12
dword http_free           = #aHTTPfree;
13
dword http_stop           = #aHTTPstop;
14
dword uri_escape          = #aURIescape;
15
dword uri_unescape        = #aURIunescape;
4163 hidnplayr 16
$DD 2 dup 0
17
 
18
char aLib_init[9]              = "lib_init\0";
19
char aHTTPget[4]               = "get\0";
4235 leency 20
char aHTTPhead[5]              = "head\0";
21
char aHTTPpost[5]              = "post\0";
22
char aFHF[18]                  = "find_header_field\0";
4163 hidnplayr 23
char aHTTPprocess[8]           = "process\0";
4235 leency 24
char aHTTPfree[5]              = "free\0";
25
char aHTTPstop[5]              = "stop\0";
26
char aURIescape[7]             = "escape\0";
27
char aURIunescape[9]           = "unescape\0";
4163 hidnplayr 28
 
29
#define FLAG_HTTP11             1 << 0
30
#define FLAG_GOT_HEADER         1 << 1
4536 leency 31
#define FLAG_GOT_ALL_DATA       1 << 2
4163 hidnplayr 32
#define FLAG_CONTENT_LENGTH     1 << 3
33
#define FLAG_CHUNKED            1 << 4
4235 leency 34
#define FLAG_CONNECTED          1 << 5
4163 hidnplayr 35
 
4165 hidnplayr 36
// error flags go into the upper word
4163 hidnplayr 37
#define FLAG_INVALID_HEADER     1 << 16
38
#define FLAG_NO_RAM             1 << 17
39
#define FLAG_SOCKET_ERROR       1 << 18
4235 leency 40
#define FLAG_TIMEOUT_ERROR      1 << 19
4536 leency 41
#define FLAG_TRANSFER_FAILED    1 << 20
4163 hidnplayr 42
 
43
struct  http_msg{
44
        dword   socket;
45
        dword   flags;
46
        dword   write_ptr;
47
        dword   buffer_length;
48
        dword   chunk_ptr;
4235 leency 49
        dword   timestamp;
4163 hidnplayr 50
        dword   status;
51
        dword   header_length;
4536 leency 52
		dword	content_ptr;
4163 hidnplayr 53
        dword   content_length;
4168 hidnplayr 54
        dword   content_received;
4536 leency 55
        char    http_header;
4163 hidnplayr 56
};