###############################################################################
# DESCRIPTION
#       This test request one specific byte using the ranges HTTP feature,
#       the target file is imgs/monkey_logo.png, the byte number 3 contains
#       a value of 0x47 which is the letter 'G'.
#
# AUTHOR
#	Eduardo Silva <edsiper@gmail.com>
#
# DATE
#	Jun 19 2013
#
# COMMENTS
#       RFC 2616 Section 10.4.17
###############################################################################


INCLUDE __CONFIG
INCLUDE __MACROS

# Start offset
SET OFF_START=3

# End offset
SET OFF_END=3

CLIENT
_CALL INIT
_CALL TESTDOC_GETSIZE

_REQ $HOST $PORT
__GET /img/mk_logo.png $HTTPVER
__Host: $HOST
__Range: bytes=${OFF_START}-${OFF_END}
__Connection: close
__

# Content length = end_offset - start_offset + 1
_OP $OFF_END SUB $OFF_START CLEN
_OP $CLEN ADD 1 CLEN

_EXPECT . "HTTP/1.1 206 Partial Content"
_EXPECT . "Date:"
_EXPECT . "G"
_WAIT
END
