summaryrefslogtreecommitdiff
path: root/module/web/server.scm
AgeCommit message (Collapse)AuthorFilesLines
2016-05-22web: Export 'server-impl' procedures and the 'http' server implementation.Ludovic Courtès1-1/+10
* module/web/server.scm: Export the 'server-impl' procedures. * module/web/server/http.scm: Export 'http'.
2013-09-13Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-6/+4
Conflicts: module/srfi/srfi-9.scm module/web/server.scm
2013-09-12Web: Use functional setters in extend-request and extend-response.Mark H Weaver1-6/+4
* module/web/client.scm (extend-request): * module/web/server.scm (extend-response): Reimplement using functional setters.
2013-09-12Web client+server: Add Content-Length header for empty bodies.Mark H Weaver1-1/+1
* module/web/client.scm (sanitize-request): Add a Content-Length header if a body if given, even if the body is empty. * module/web/server.scm (sanitize-response): Add a Content-Length header if a body if given, even if the body is empty.
2013-01-15Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-37/+3
There is a failing test due to a scm_from_utf8_stringn bug brought out by the iconv test that will be fixed in the next commit. Conflicts: libguile/deprecated.h module/ice-9/deprecated.scm
2013-01-11(web server) uses (ice-9 iconv)Andy Wingo1-37/+3
* module/web/server.scm (sanitize-response): Use the procedures from (ice-9 iconv) to encode the response.
2013-01-07Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-29/+29
Conflicts: GUILE-VERSION libguile/posix.c module/ice-9/eval.scm test-suite/tests/cse.test
2012-11-24syncronize web module docstrings with manualDaniel Hartwig1-29/+29
* doc/ref/web.texi: Fix spacing. Update with a few missing function descriptions. * module/web/client.scm: * module/web/http.scm: * module/web/request.scm: * module/web/server.scm: * module/web/uri.scm: Update docstrings from manual (reworked by Ludovic Courtès).
2012-03-06micro-optimization in (web server)Andy Wingo1-2/+4
* module/web/server.scm (extend-response): Micro-optimize to not mutate data, and to copy as little as possible.
2012-02-14web server: fix spurious warningAndy Wingo1-1/+3
* module/web/server.scm (sanitize-response): Quick fix to the 304-has-no-body sanitizer.
2012-02-12web server: do not provide a response body where it is not permittedAndy Wingo1-4/+11
* module/web/response.scm (response-must-not-include-body?): New function. * doc/ref/web.texi: Doc the function. * module/web/server.scm (sanitize-response): Error if we have a body, but the response type does not permit a body. If we are responding to a HEAD request, silently drop the body.
2012-02-11web server: print backtrace on errors when run in batch modeAndy Wingo1-16/+8
* module/web/server.scm (read-client, handle-request, write-client): When run in batch mode, give a full backtrace for errors.
2011-09-02more define-syntax-rule usageAndy Wingo1-5/+3
* module/ice-9/boot-9.scm: * module/ice-9/control.scm: * module/ice-9/futures.scm: * module/ice-9/optargs.scm: * module/ice-9/poll.scm: * module/ice-9/receive.scm: * module/ice-9/threads.scm: * module/ice-9/vlist.scm: * module/language/assembly/compile-bytecode.scm: * module/language/ecmascript/compile-tree-il.scm: * module/language/tree-il.scm: * module/oop/goops.scm: * module/oop/goops/simple.scm: * module/oop/goops/stklos.scm: * module/srfi/srfi-1.scm: * module/srfi/srfi-35.scm: * module/srfi/srfi-39.scm: * module/srfi/srfi-45.scm: * module/srfi/srfi-67/compare.scm: * module/sxml/match.scm: * module/system/repl/error-handling.scm: * module/system/repl/repl.scm: * module/system/vm/inspect.scm: * module/texinfo.scm: * module/web/server.scm: Use define-syntax-rule, where it makes sense.
2011-02-24web server more assiduous about closing portsAndy Wingo1-8/+23
* module/web/uri.scm: * module/web/server.scm (call-with-output-string*): (call-with-output-bytevector*): Local procs to output to strings or bytevectors, *and then close the port*. We can't make this change in call-with-output-string because it would be incompatible. * module/web/uri.scm (call-with-encoded-output-string, decode-string) (uri-decode) * module/web/server.scm (call-with-encoded-output-string): Use the new helpers.
2011-02-18core modules use (ice-9 binary-ports) instead of (rnrs io ports)Andy Wingo1-1/+1
* module/language/assembly/compile-bytecode.scm: * module/language/elisp/lexer.scm: * module/web/request.scm: * module/web/response.scm: * module/web/server.scm: * module/web/uri.scm: Use ice-9 binary-ports.
2011-01-10request and response cleanupsAndy Wingo1-0/+11
* module/web/request.scm (build-request): Make URI a positional argument. * module/web/response.scm: Remove extend-response. (read-response): Fix a docstring. * module/web/server.scm (extend-response): Include extend-response here, but not exported.
2011-01-08(web http): keys are always symbolsAndy Wingo1-8/+8
* module/web/http.scm (parse-media-type): Parse media types as symbols. (parse-key-value-list, parse-param-component, parse-param-list): Change kons to val-parser. Always parse keys as symbols, and always either cons, if there is a val, or just have the key, if there is no val. Easier to explain and just as correct. (declare-param-list-header!, declare-key-value-list-header!): Adapt to key-list and param-list kons change. ("Cache-Control", "Pragma", "Transfer-Encoding", "Accept", "Expect") ("TE"): Likewise, adapt. ("Content-Type"): Param keys are symbols.
2010-12-16(web server) docstringsAndy Wingo1-0/+77
* module/web/server.scm: Docstrings in the house.
2010-12-12fix testing code in web/serverAndy Wingo1-2/+2
* module/web/server.scm (call-with-encoded-output-string): Fix some code I accidentally left in while testing. Re-tested the difference in speed; pleasantly surprised. * module/web/uri.scm: Make the same change here.
2010-12-03(web server) punts keep-alive to impls; http server uses (ice-9 poll)Andy Wingo1-41/+21
* module/web/server.scm: Rewrite to remove the extra "keep-alive" parameter. Instead, since the server is an essentially stateful object, have clients that want to do keep-alive manage that set as part of the server state. Also avoids imposing a particular data structure on the server implementation. * module/web/server/http.scm: Adapt to the new server interface. Also, use a poll set instead of select and lists. Makes handling 1000 clients at a time much more possible.
2010-12-02add some debugging to (web server)Andy Wingo1-1/+26
* module/web/server.scm: Add some basic elapsed-time debugging, but only if you flip a switch to turn it on at expand-time.
2010-12-02(web server) supports non-utf-8 charsetsAndy Wingo1-9/+32
* module/web/server.scm (sanitize-response): Support charsets other than utf-8. Oddly collecting a string and converting it to utf-8 appears to be faster than collecting a utf-8 bytevector directly.
2010-12-01stub fixes to http 1.0 support in the web serverAndy Wingo1-25/+36
* module/web/server.scm (read-client): Fix number of returned values in the case in which there is an error reading the client. (sanitize-response): Add a case to adapt the reponse to the request version. (handle-request): Sanitize the response within an error-handling block. (serve-one-client): Move sanitation out of here. * module/web/server/http.scm (keep-alive?): A more proper detection on whether we should support persistent connections. * module/web/response.scm (adapt-response-version): New routine, to adapt a response to a given version. Currently a stub.
2010-11-23fix web server bugsAndy Wingo1-3/+3
* module/web/http.scm (valid-quality?): * module/web/server.scm (sanitize-response): Fix a couple bugs.
2010-11-22fix up a couple content-length issues in web/server.scm:sanitize-responseAndy Wingo1-7/+10
* module/web/server.scm (sanitize-response): Allow body to be #f. Don't require or insert a content-length if there is no body.
2010-11-13flesh out (web server)'s sanitize-responseAndy Wingo1-1/+37
* module/web/server.scm (sanitize-response): Flesh out. If we get a string, we encode it to a bytevector using the encoding snarfed from the response. We should check the request, though...
2010-11-12add generic web server with http-over-tcp backendAndy Wingo1-0/+242
* module/web/server.scm: New generic web server module, with support for different backends. An HTTP-over-TCP backend is the only one included with Guile, though one can imagine FastCGI, mod-lisp, mongrel2/0mq etc backends as well. * module/web/server/http.scm: The aforementioned HTTP backend.