Commit Graph

  • 813d4463bc . Add read_line() and chomp(). . Greatly simplify parse_extension_map_file(). Emil Mikulic 2003-11-17 12:42:42 +0000
  • a4740dfda2 . Uncast xmalloc() and xrealloc() returns. . Changed #if IDLETIME' to if (IDLETIME)' - it will be optimized away by the compiler. . Some casts and an int->size_t change to keep splint happy about integer types. Emil Mikulic 2003-11-15 05:16:19 +0000
  • b1b9432123 Changes to comments that have been waiting since Aug 4 07:54. Emil Mikulic 2003-11-15 04:41:17 +0000
  • 6bb5b5af42 . Make mime_map a sorted array instead of a LIST_. . Added add_mime_mapping() to add to mime_map in unsorted order. . Added sort_mime_map() - uses qsort() and mime_mapping_cmp() to sort the mime_map. . uri_content_type() uses bsearch() and mime_mapping_cmp_str() to search through the mime_map for an extension parsed out of a specified URI. . Free mime_map in exit_quickly() . Completely deallocate connlist in exit_quickly() . In main(), parse_commandline() after parse_default_extension_map() so that a specified --mimetypes file will -override- the defaults. Emil Mikulic 2003-06-30 02:11:24 +0000
  • f56dcd2b76 Borged parts of sys/queue.h since non-BSDs don't have the header. Emil Mikulic 2003-06-28 04:13:19 +0000
  • 9d6d7533fe . Linux needs _GNU_SOURCE defined. . bindport is uint16_t like in Linux. . Fix a bounds error in make_safe_uri(). . Remember to free temporaries in make_safe_uri(). . Free if_mod_since in process_get() . Set reply_file to NULL after closing it in poll_send_reply() to avoid double fclose() in free_connection(). . Don't log connections with http_code == 0; these are connections that failed while receiving the request string. . Initialise timeout more cleanly in httpd_poll(). . Made MAX_FD_SET use a { block } to keep gcc 3 happy. . Don't free items in a LIST_FOREACH() block; use a temporary next pointer and LIST_NEXT(). . exit_quickly() closes logfile if it's open. . exit_quickly() doesn't re-throw the signal that triggered it. Emil Mikulic 2003-06-27 08:16:48 +0000
  • d7bfc32d6d . Partial content is done, mark off TODO. . Decrease send BUFSIZE to 40,000 (max I've seen is 33,000). . Remove a debugf() from poll_send_reply(). . Add exit_quickly(). . SIGINT and SIGQUIT exit_quickly(). Emil Mikulic 2003-06-27 07:01:28 +0000
  • 67604878ec . Initialise range_* in struct connection. . 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. Emil Mikulic 2003-06-27 06:42:42 +0000
  • 295cd40bbb int type fixes to keep splint happy. Emil Mikulic 2003-06-27 05:38:10 +0000
  • 7090baae35 . Added range fields to struct connection. . Added sanity check in split_string(): left <= right . Implemented parse_range_field() Emil Mikulic 2003-06-27 05:31:55 +0000
  • 6ee7a85231 . Got rid of conn->lastmod field. . rfc1123_date() takes a destination buffer instead of having the one, static, global buffer. Emil Mikulic 2003-06-07 00:51:57 +0000
  • 6e0103cbc4 Fiddling with signed-ness and types to make splint happy. Emil Mikulic 2003-06-07 00:09:53 +0000
  • 0c1ff8a258 Cleared up parse_field() synopsis. Emil Mikulic 2003-06-06 21:08:54 +0000
  • 3dc4ce1216 . Made all sockets non-blocking . Used simpler way of ignoring SIGPIPE . Made sure closed sockets aren't written to Emil Mikulic 2003-06-04 16:07:01 +0000
  • 70cbd12463 . Tested If-Modified-Since functionality . Update last_active so connections don't time out (this also tested out the timeout functionality) . Sprinkling of debugf()s Emil Mikulic 2003-06-04 14:56:29 +0000
  • ce7cfceabb Worked out warning flags from gcc manpage Emil Mikulic 2003-06-04 14:29:28 +0000
  • 0d755c3618 . Added ogg mimetype . Added xvasprintf() . Added xasprintf() . Some signed/unsigned clarifications . Simplified asprintf() error handling using xasprintf() . Check for failure of signal() Emil Mikulic 2003-06-04 14:29:28 +0000
  • 5a6c7cf08e . Added lastmod (reply, not request) to struct connection . 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() Emil Mikulic 2003-03-08 11:54:58 +0000
  • 72d0b5b301 . Use reasm instead of checking for a NULL reassembly element (safer) Emil Mikulic 2003-03-08 11:33:17 +0000
  • ce5eaa9f94 . Made split_string() return a string instead of taking char **dest . 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) Emil Mikulic 2003-03-08 11:30:14 +0000
  • 5c0c18798c . Content-Type is now derived from mime_map . 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 Emil Mikulic 2003-03-08 08:33:24 +0000
  • 7a2daecf22 . Added debugf() to parse_mimetype_line() . Added parse_extension_map_file() . Added --mimetypes to usage() and parse_commandline() Emil Mikulic 2003-03-08 05:43:20 +0000
  • a0d608d1e3 . Added LIST mime_map . Added struct mime_mapping . Added default_extension_map[] . Moved xmalloc() to top of file . Added split_string() . Added parse_mimetype_line() . Added parse_default_extension_map() . Made new_connection(), parse_request() use split_string() . Comment in log_connection(): client -> client_ip Emil Mikulic 2003-03-08 04:58:07 +0000
  • d6b7871ade . TODO: dir entries -> dir listings . TODO: minor cleanup . --help as first parameter results in usage() Emil Mikulic 2003-03-07 08:25:04 +0000
  • 7c29be2b7d . Added referer, user_agent to struct connection . 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() Emil Mikulic 2003-03-07 08:10:03 +0000
  • aa2245e867 . Added expand_tilde() . Added strip_endslash() . wwwroot gets its tilde expanded and trailing slash clipped off Emil Mikulic 2003-03-07 05:58:35 +0000
  • f5703a9c82 . Added TODO entries . Minor whitespace fixes Emil Mikulic 2003-03-07 02:35:27 +0000
  • 09d69063bd . Ignoring SIGPIPE . httpd_poll()'s select() will timeout after IDLETIME seconds if there are any connections currently in a send/recv state Emil Mikulic 2003-03-01 10:10:27 +0000
  • 4456c044e5 . Implemented logging to file . 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() Emil Mikulic 2003-03-01 10:00:06 +0000
  • 02964cc5a6 . TODO: Added If-Modified-Since . 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) Emil Mikulic 2003-03-01 09:07:56 +0000
  • 32b3855aeb . Added SIGPIPE ignoring to TODO . 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() Emil Mikulic 2003-03-01 07:44:51 +0000
  • 0615eb6a88 . Added to TODO list . Default value for sockin is -1 . Added index_name default, parsing of --index, usage of --index . Dereference char **method when passing to strntoupper() Emil Mikulic 2003-03-01 07:13:12 +0000
  • 98c9fd318e . Added TODO list . Changed a comment Emil Mikulic 2003-03-01 07:01:56 +0000
  • b959c6bc3a . Added 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 Emil Mikulic 2003-02-28 11:21:31 +0000
  • fd0a618d34 Initial implementation of parse_request() Emil Mikulic 2003-02-28 10:39:43 +0000
  • 3759104f07 . Added rfc1123_date() and Date: header field to default_reply() . Skeleton for parse_request() Emil Mikulic 2003-02-28 00:09:41 +0000
  • 9074924be5 . Added MAX_REQUEST_LENGTH and a check for it in poll_recv_request() . Fixed comment DEFAULT_PORT -> bindport . "options:\n" -> "options:\n\n" Emil Mikulic 2003-02-27 23:41:44 +0000
  • cb3342472b . default_reply() ensures reply_type is REPLY_GENERATED . Implemented poll_send_header() . Partial implementation of poll_send_file() - can't send FROMFILE yet Emil Mikulic 2003-02-27 03:58:42 +0000
  • 23b191239e . Added to struct connection: 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() Emil Mikulic 2003-02-27 03:21:36 +0000
  • ebe1e1bfa0 . Added LIST (sys/queue.h) of struct connection . Added xmalloc() . Filled out accept_connection() . Added free_connection() . Added xrealloc() . Started poll_recv_request() . Skeletons for poll_send_header(), poll_send_reply() . Filled out httpd_poll() Emil Mikulic 2003-02-26 11:09:43 +0000
  • 345c214212 . Added struct connection . Skeleton accept_connection() . Incomplete httpd_poll() Emil Mikulic 2003-02-21 00:53:45 +0000
  • 7a8ff37bb3 . Changed argument --bind' -> --addr' . Implemented arg parsing for port, addr, maxconn, log, chroot . init_sockin() prints the addr:port that sockin is bound to Emil Mikulic 2003-02-20 10:31:34 +0000
  • 79e52dfae2 . Moved pkgname, copyright to top of file to avoid having to duplicate 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] Emil Mikulic 2003-02-20 07:01:34 +0000
  • 26aeb38a81 Initial revision - open and close a socket. Emil Mikulic 2003-02-20 04:25:12 +0000