. Added reply_start to struct connection.
. Added debugf() to free_connection().
. Construct HTTP 206 reply if Range specified.
. Take reply_start into consideration in poll_send_reply().
. Added fread() error handling - eof is non-fatal.
. Added xstrdup()
. Made expand_tilde use xstrdup() instead of strdup() (whoops)
. process_get() now handles "If-Modified-Since:"
. lastmod is generated before Date: so that only one asprintf() is
needed to construct the header in process_get()
. Added make_safe_uri()
. Modified split_string() calls to match new prototype
. process_get() uses make_safe_uri() to prevent walking out of wwwroot
. free(target) AFTER we finish using it in process_get (whoops)
. Reordered default_extension_map[] for search speed
. Added uri_content_type()
. process_get() calls uri_content_type() when needed
. Removed a couple of debugf()s from process_request
. Moved xrealloc() to top of file
. Added parse_field()
. parse_request() calls parse_field() for referer, ua
. Logfile is opened in append mode, not write mode
. strip_endslash() calls xrealloc(), not realloc()
. Moved parse_request's {method|url} to conn->{method|uri}
. Added http_code, total_sent to struct connection
. Added out-of-memory checks on a few asprintf()s
. Added assert()s where I tripped up before or could again
. Added log_connection()
. Open logfile from logfile_name in main()
. TODO: Marked off Actually serve files
. Added min(a,b) macro
. Moved header_only from process_get() to struct connection
. MAX_REQUEST_LENGTH from 20000 to 4000
. xrealloc() to strlen+1 in urldecode()
. Made default_reply() take variable arguments like printf
. Mostly implemented process_get()
. Handling of file-not-found
. Handling of other fopen() errors
. Header generation (except Content-Type)
. Made default_replies more specific
. poll_send_header() advances state to DONE if header_only
. Completed poll_send_reply() (implemented REPLY_FROMFILE)
. Clear reply_sent and reply_length in new_connection()
This was causing a bug that couldn't be seen on the first web request.
. Added urldecode()
. Started work on process_get()
. Default value for sockin is -1
. Added index_name default, parsing of --index, usage of --index
. Dereference char **method when passing to strntoupper()
. rfc1123_date() now takes a time_t argument
. default_reply() now takes a `reason' string
. Skeleton process_get()
. Implemented process_request() completely (for now) (I hope)
. Changed oversized request error from 400 Bad Request
to 413 Request Entity Too Large
o in_addr_t client
o time last_active
o {header,reply}_dont_free
. Added IDLETIME and poll_check_timeout()
. Added new_connection() and moved conn initialisation there
. Added default_reply()
. Skeleton for process_request()
. connnection.request is now null-terminated
. Removed debug code from poll_recv_request()
it in the comments.
. Got rid of DEFAULT_* defines in favour of initializers.
. Moved existing socket creation code to init_sockin().
. Added usage(). [needs work]
. Added parse_commandline() skeleton. [needs a lot of work]