Do you want to change something in this source?
Well I'll explain the basic program flow and such
so that you have a global overview.. Many sources
are terrible and impossible to grasp.. this one
shouldn't be too hard.

Remember the LICENSE agreement though. And also
if you make bugfixes, ports, or any other usefull
gadgets, please contact me so I can intergrate them
within the main code. :)
Full credits will be given offcourse.

PS.

This probably needs updating.. but this is not too
important..


Program flow
------------

 - Declare variables and pointers     

 - Parse and copy commandline options        

 - Build a HTTP request from the arguments given

 - Open socket                        

 - Write request                      

 | - Read response                      
 |
 | - Parse headers if present
 |
 | - Output data if headers are done
 |
 | - Loop until all data received, or not getting any more
 
 - Close socket                       




Source Files
------------

Makefile          - Makefile to compile htdump
arguments.c       - Everything for building the HTTP request
delnchar.c        - Some string manipulation funtions
enc_password.c    - Base64 encodes a username and password if given
file.c            - All the file I/O stuff
global.h          - Global variables and headers
init.c            - Copies and parses the arguments from the commandline
main.c            - Main of the program, should be short
mem2hex.c         - Used for debug, to print data hexadecimal on the screen
read_headers.c    - The part that filters out the headers
sgets.c           - Simple function like fgets, only then from a buffer
socket-ssl.c      - Sets the SSL define, then opens socket.c
socket.c          - Open a connection to the server
title.c           - Not used yet
usage.c           - The help screen





Below are some extra notes that I will
probably need, you can ignore them.

/*

  Request headers

  | Accept
  | Accept-Charset
  | Accept-Encoding
  | Accept-Language
  | Authorization
  | From
  | Host
  | If-Modified-Since
  | If-Match
  | If-None-Match
  | If-Range
  | If-Unmodified-Since
  | Max-Forwards
  | Proxy-Authorization
  | Range
  | Referer
  | User-Agent


  Response codes

  | "100"  ; Continue
  | "101"  ; Switching Protocols
  | "200"  ; OK
  | "201"  ; Created
  | "202"  ; Accepted
  | "203"  ; Non-Authoritative Information
  | "204"  ; No Content
  | "205"  ; Reset Content
  | "206"  ; Partial Content
  | "300"  ; Multiple Choices
  | "301"  ; Moved Permanently
  | "302"  ; Moved Temporarily
  | "303"  ; See Other
  | "304"  ; Not Modified
  | "305"  ; Use Proxy
  | "400"  ; Bad Request
  | "401"  ; Unauthorized
  | "402"  ; Payment Required
  | "403"  ; Forbidden
  | "404"  ; Not Found
  | "405"  ; Method Not Allowed
  | "406"  ; Not Acceptable
  | "407"  ; Proxy Authentication Required
  | "408"  ; Request Time-out
  | "409"  ; Conflict
  | "410"  ; Gone
  | "411"  ; Length Required
  | "412"  ; Precondition Failed
  | "413"  ; Request Entity Too Large
  | "414"  ; Request-URI Too Large
  | "415"  ; Unsupported Media Type
  | "500"  ; Internal Server Error
  | "501"  ; Not Implemented
  | "502"  ; Bad Gateway
  | "503"  ; Service Unavailable
  | "504"  ; Gateway Time-out
  | "505"  ; HTTP Version not supported


  Response header

  | Age
  | Location
  | Proxy-Authenticate
  | Public
  | Retry-After
  | Server
  | Vary
  | Warning
  | WWW-Authenticate


  Entity header

  | Allow
  | Content-Base
  | Content-Encoding
  | Content-Language
  | Content-Length
  | Content-Location
  | Content-MD5
  | Content-Range
  | Content-Type
  | ETag
  | Expires
  | Last-Modified


*/


Post procedure:

POST /cgi-bin/process HTTP/1.0
Referer: http://192.168.1.22:81/_system/_time/time.shtml
Connection: Keep-Alive
User-Agent: Mozilla/4.7 [en] (Win98; U)
Host: 192.168.1.22:81
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
Content-type: application/x-www-form-urlencoded
Content-length: 65

_SECTION=TIME&_TIME1=18&_TIME2=14&_DATE1=28&_DATE2=02&_DATE3=2000


