2013-11-04 17:07:21 +04:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2015-03-20 15:04:14 +03:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
|
2013-11-04 17:07:21 +04:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;; HTTP library for KolibriOS ;;
|
|
|
|
;; ;;
|
|
|
|
;; Written by hidnplayr@kolibrios.org ;;
|
|
|
|
;; ;;
|
|
|
|
;; GNU GENERAL PUBLIC LICENSE ;;
|
|
|
|
;; Version 2, June 1991 ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
2013-11-11 21:28:49 +04:00
|
|
|
; Bitflags for http_msg.flags
|
2015-03-20 15:04:14 +03:00
|
|
|
|
|
|
|
; status
|
2013-11-04 17:07:21 +04:00
|
|
|
FLAG_HTTP11 = 1 shl 0
|
|
|
|
FLAG_GOT_HEADER = 1 shl 1
|
2013-11-11 15:35:18 +04:00
|
|
|
FLAG_GOT_ALL_DATA = 1 shl 2
|
2013-11-04 17:07:21 +04:00
|
|
|
FLAG_CONTENT_LENGTH = 1 shl 3
|
|
|
|
FLAG_CHUNKED = 1 shl 4
|
2013-11-11 15:35:18 +04:00
|
|
|
FLAG_CONNECTED = 1 shl 5
|
2015-03-20 15:04:14 +03:00
|
|
|
|
|
|
|
; user options
|
|
|
|
FLAG_KEEPALIVE = 1 shl 8
|
2015-03-20 17:00:21 +03:00
|
|
|
FLAG_STREAM = 1 shl 9
|
|
|
|
FLAG_REUSE_BUFFER = 1 shl 10
|
2015-03-20 15:04:14 +03:00
|
|
|
|
|
|
|
; error
|
2013-11-04 17:07:21 +04:00
|
|
|
FLAG_INVALID_HEADER = 1 shl 16
|
|
|
|
FLAG_NO_RAM = 1 shl 17
|
|
|
|
FLAG_SOCKET_ERROR = 1 shl 18
|
2013-11-11 16:29:54 +04:00
|
|
|
FLAG_TIMEOUT_ERROR = 1 shl 19
|
2013-11-13 00:08:02 +04:00
|
|
|
FLAG_TRANSFER_FAILED = 1 shl 20
|
2013-11-04 17:07:21 +04:00
|
|
|
|
|
|
|
struc http_msg {
|
2013-11-11 21:28:49 +04:00
|
|
|
|
|
|
|
.socket dd ? ; socket on which the actual transfer happens
|
|
|
|
.flags dd ? ; flags, reflects status of the transfer using bitflags
|
|
|
|
.write_ptr dd ? ; internal use only (where to write new data in buffer)
|
|
|
|
.buffer_length dd ? ; internal use only (number of available bytes in buffer)
|
|
|
|
.chunk_ptr dd ? ; internal use only (where the next chunk begins)
|
|
|
|
.timestamp dd ? ; internal use only (when last data was received)
|
2014-01-28 01:15:30 +04:00
|
|
|
|
2013-11-11 21:28:49 +04:00
|
|
|
.status dd ? ; HTTP status
|
|
|
|
.header_length dd ? ; length of HTTP header
|
2014-01-28 01:15:30 +04:00
|
|
|
.content_ptr dd ? ; ptr to content
|
|
|
|
.content_length dd ? ; total length of HTTP content
|
2013-11-11 21:28:49 +04:00
|
|
|
.content_received dd ? ; number of currently received content bytes
|
2014-01-28 01:15:30 +04:00
|
|
|
|
|
|
|
.http_header:
|
2013-11-11 21:28:49 +04:00
|
|
|
|
2013-11-04 17:07:21 +04:00
|
|
|
}
|