-*- org -*- * Notes * Tasks [7/9] ** TODO Documentation [0/4] - [ ] introduction - [ ] handlers - [ ] request headers - [ ] usage examples - [ ] list of functions Notes to touch upon - [ ] how to set content type ** DONE Handle POST requests 1. read standard for POST data 2. parse multi-line headers with boundaries For now keep this all incremental and in ews-filter. ** DONE Makefile - byte-compile - package - test - benchmark ** DONE catch errors and return an error code include an easy error handler like the 404 handler ** DONE better parsing of multipart form blocks parse more than just the content-type headers. ** DONE non-multipart form data e.g., parameter strings ** DONE some more convenience functionality [6/6] - [X] strip and parse URL query string - [X] parse urlencoded post data - [X] think about defaulting to (name . content) for form elements - [X] maybe don't require a non-nil return to cancel the connection, instead only keep open if :keep-open is returned - [X] function to send a file (with mime handling) - [X] send a 404 with some default text ** CANCELED Lazy header processing - State "CANCELED" from "TODO" [2013-12-25 Wed 12:21] \\ premature optimization Use lazy sequence functions for header a-list to avoid parsing all headers. For regexp matchers should stop when matched header is encountered (often the first one when :GET), For function matchers provide lazy version of assoc. Also, there is the issue of how a lazy request for more parameters should act before all incoming text has been received. Emacs does not provide a light-weight mechanism for a function to wait for incoming process text without something gross like the =(sit-for 0.1)= used in the test suite. ** TODO use gnutls for https I think this should work. * Documentation ** Writing Handlers *** Matching *** Handler Functions At any time one can throw =close-connection= to abort the handler and close the conncetion. If the keyword =:keep-open= is thrown, then the handler aborts, but the connection isn't closed. A return value of =:keep-open= will keep the connection open, otherwise it is closed when the handler returns.