Rev 5732 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4158 | hidnplayr | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
7969 | hidnplayr | 3 | ;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;; |
4158 | hidnplayr | 4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
||
6 | ;; HTTP library for KolibriOS ;; |
||
7 | ;; ;; |
||
8 | ;; Written by hidnplayr@kolibrios.org ;; |
||
9 | ;; ;; |
||
10 | ;; GNU GENERAL PUBLIC LICENSE ;; |
||
11 | ;; Version 2, June 1991 ;; |
||
12 | ;; ;; |
||
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
14 | |||
15 | |||
4209 | hidnplayr | 16 | ; Bitflags for http_msg.flags |
5534 | hidnplayr | 17 | |
18 | ; status |
||
4158 | hidnplayr | 19 | FLAG_HTTP11 = 1 shl 0 |
20 | FLAG_GOT_HEADER = 1 shl 1 |
||
4205 | hidnplayr | 21 | FLAG_GOT_ALL_DATA = 1 shl 2 |
4158 | hidnplayr | 22 | FLAG_CONTENT_LENGTH = 1 shl 3 |
23 | FLAG_CHUNKED = 1 shl 4 |
||
4205 | hidnplayr | 24 | FLAG_CONNECTED = 1 shl 5 |
5534 | hidnplayr | 25 | |
26 | ; user options |
||
27 | FLAG_KEEPALIVE = 1 shl 8 |
||
5537 | hidnplayr | 28 | FLAG_STREAM = 1 shl 9 |
29 | FLAG_REUSE_BUFFER = 1 shl 10 |
||
5732 | hidnplayr | 30 | FLAG_BLOCK = 1 shl 11 |
7969 | hidnplayr | 31 | FLAG_RING = 1 shl 12 |
5534 | hidnplayr | 32 | |
33 | ; error |
||
4158 | hidnplayr | 34 | FLAG_INVALID_HEADER = 1 shl 16 |
7969 | hidnplayr | 35 | FLAG_NO_RAM = 1 shl 17 ; alloc failed |
4158 | hidnplayr | 36 | FLAG_SOCKET_ERROR = 1 shl 18 |
4206 | hidnplayr | 37 | FLAG_TIMEOUT_ERROR = 1 shl 19 |
4220 | hidnplayr | 38 | FLAG_TRANSFER_FAILED = 1 shl 20 |
7969 | hidnplayr | 39 | FLAG_NEED_MORE_SPACE = 1 shl 21 ; need more space in existing buffer |
4158 | hidnplayr | 40 | |
41 | struc http_msg { |
||
4209 | hidnplayr | 42 | |
43 | .socket dd ? ; socket on which the actual transfer happens |
||
44 | .flags dd ? ; flags, reflects status of the transfer using bitflags |
||
45 | .write_ptr dd ? ; internal use only (where to write new data in buffer) |
||
46 | .buffer_length dd ? ; internal use only (number of available bytes in buffer) |
||
47 | .chunk_ptr dd ? ; internal use only (where the next chunk begins) |
||
48 | .timestamp dd ? ; internal use only (when last data was received) |
||
4541 | hidnplayr | 49 | |
4209 | hidnplayr | 50 | .status dd ? ; HTTP status |
51 | .header_length dd ? ; length of HTTP header |
||
4541 | hidnplayr | 52 | .content_ptr dd ? ; ptr to content |
53 | .content_length dd ? ; total length of HTTP content |
||
4209 | hidnplayr | 54 | .content_received dd ? ; number of currently received content bytes |
55 | |||
4541 | hidnplayr | 56 | .http_header: |
57 | |||
4158 | hidnplayr | 58 | } |