
[-mt | -mf]	File creation mode. -mt creates directory tree. -mf stores only the file.
		-mt is default.

-f filename	A file which contains a list of URLs to download

-u agent	A user agent to masquerade as. agent can be ie, ns or a quoted user string.
		Default is http_get/version.

urls		A list of URLs may be specified on the command line. These have a higher
		priority than those in the file specified with -f.


http_get -u ie http://www.somesite.com/somefile.zip

http_get -mf -f urls.txt


FOR EACH url
	Get Or Make Output File

	IF File Existed
		// Roll back 4K
		IF ($bytes_got_already % 4096) == 0 THEN
			set $bytes_got_already -= 4096
		ELSE
			set $bytes_got_already -= ($bytes_got_already % 4096)
		ENDIF
	ELSE
		$bytes_got_already = 0
	ENDIF

	// $bytes_got_already is continuation point
	
	Validate url
	IF Invalid NEXT url
	
	Get IP address of server

	Open connection

	Build request

	Send request

	Decode response
	
	IF $bytes_got_already = 0
		$file_size = Content-Length
	ELSE
		$file_size = Content-Range
	ENDIF

	Read bytes from connection
	WHILE $bytes_read > 0 
		Write $bytes_read to file
		$bytes_got_already += $bytes_read
		Read bytes from connection
	END WHILE

	IF $bytes_got_already < $file_size
		// Premature connection close
		RETRY
	ENDIF

	Close connection if required
	Close files if required

NEXT url
