Skip to content

Commit

Permalink
Merge pull request #14 from avsm/master
Browse files Browse the repository at this point in the history
release 0.10.0
  • Loading branch information
avsm committed Mar 2, 2014
2 parents 5f532c7 + 9841833 commit bbf0b9c
Show file tree
Hide file tree
Showing 43 changed files with 1,063 additions and 736 deletions.
21 changes: 15 additions & 6 deletions .travis-ci.sh
@@ -1,4 +1,4 @@
OPAM_DEPENDS="lwt async ssl uri re mirage-tcpip-unix mirage-tcpip-xen"
OPAM_DEPENDS="lwt async ssl uri re"

case "$OCAML_VERSION,$OPAM_VERSION" in
4.00.1,1.0.0) ppa=avsm/ocaml40+opam10 ;;
Expand All @@ -20,14 +20,23 @@ echo OPAM versions
opam --version
opam --git-version

# opam init git://github.com/ocaml/opam-repository >/dev/null 2>&1
opam init
opam init git://github.com/ocaml/opam-repository >/dev/null 2>&1
opam install ${OPAM_DEPENDS}

eval `opam config env`
make
#make test

make NETTESTS=--enable-nettests
make test
make clean
# Test out some upstream users of Cohttp
opam pin cohttp .

unset OPAMVERBOSE
opam install github
opam install cowabloga
opam install mirage-www

case "$OCAML_VERSION" in
4.01.0)
opam install irminsule ;;
*) echo Skipping irminsule ;;
esac
16 changes: 16 additions & 0 deletions CHANGES
@@ -1,3 +1,19 @@
0.10.0 (2014-03-02):
* Interface change: The `Request` and `Response` module types now explictly
signal `Eof` and `Invalid` (for errors), to help the backend distinguish them.
* Interface change: Unify HTTP body handling across backends into a `Cohttp.Body`
module. This is extended by Async/Lwt implementations with their specific
ways of handling bodies (Pipes for Async, or Lwt_stream for Lwt).
* [lwt] Interface change: HTTP client calls now raise Lwt exceptions rather
than return an option type. This permits better error handling in Lwt.
* [lwt] Interface change: The `Server` callback now always provides a `body`
argument, since `Cohttp_lwt_body` now explicitly supports empty bodys.
* Add `Cohttp.Header.is_keep_alive` to test if a connection should be reused.
* [lwt] Respect the `keep-alive` header in the server request handling.
* [async] Add a `Body` that takes a `Pipe` or a `string`, similarly to Lwt.
* Install `cohttp-server` binary even if tests are disabled.
* Begin an `examples` directory with some simple uses of the library.

0.9.16 (2014-01-30):
* Add some module type equalities in `Cohttp_lwt_unix` so that
`Cohttp_lwt_unix.Server.Request.IO.ic` can be equivalen to `Lwt_io.input_channel`.
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Expand Up @@ -7,8 +7,7 @@ NAME=cohttp
LWT ?= $(shell if ocamlfind query lwt >/dev/null 2>&1; then echo --enable-lwt; fi)
LWT_UNIX ?= $(shell if ocamlfind query lwt.ssl >/dev/null 2>&1; then echo --enable-lwt-unix; fi)
ASYNC ?= $(shell if ocamlfind query async >/dev/null 2>&1; then echo --enable-async; fi)
# disabled by default as they hang at the moment for Async
# NETTESTS ?= --enable-nettests
NETTESTS ?= --enable-nettests

setup.bin: setup.ml
ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
Expand Down
17 changes: 8 additions & 9 deletions TODO.md
@@ -1,25 +1,24 @@
Planned interface-breaking changes before 1.0:

* Make the Header.t header parsing more efficient by only lazily parsing them
instead of copying into a Map as we do now.
Planned changes for 1.0:

* Make the Lwt response stream bounded (new in lwt-2.4+)

* Header module needs to deal with repeated keys correctly (by folding
them into the string list of values)

* Should read_form really be in lib/ ? It could just be implemented in the
drivers. But then again, that would be repeated code in all the backends.

- SSL support for Async

Planned changes for 2.0:

* Make the Header.t header parsing more efficient by only lazily parsing them
instead of copying into a Map as we do now.

Better HTTP support:

- Range requests need to be fully implemented (206)
- 100 Continue should be a noop
- Awwww crap, so much to do : http://www.and.org/texts/server-http
- Lwt Connection: close support
- A client interface that deals with redirects
- Proxy support (manual means a full URI in the request)
- SSL support for Async?

Tests:

Expand Down
15 changes: 12 additions & 3 deletions _oasis
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: cohttp
Version: 0.9.16
Version: 0.10.0
Synopsis: HTTP library for Lwt, Async and Mirage
Authors: Anil Madhavapeddy, Stefano Zacchiroli, David Sheets, Thomas Gazagnaire, David Scott, Rudy Grinberg
License: ISC
Expand All @@ -12,7 +12,7 @@ Library cohttp
Findlibname: cohttp
Pack: true
Modules: IO, Code, Header, Cookie, Request, Response, Transfer, Accept, Accept_parser,
Accept_lexer, Accept_types, Base64, Auth, Header_io, Transfer_io, Client, Connection
Accept_lexer, Accept_types, Base64, Auth, Header_io, Transfer_io, Client, Connection, Body
BuildDepends: re, uri (>= 1.3.8), uri.services, fieldslib, fieldslib.syntax, sexplib, sexplib.syntax

Flag lwt
Expand Down Expand Up @@ -204,12 +204,21 @@ Executable test_net_async_server
Executable "cohttp-server"
Path: bin
MainIs: cohttp_server_async.ml
Build$: flag(tests) && flag(async)
Build$: flag(async)
Custom: true
CompiledObject: best
Install: true
BuildDepends: cohttp, cohttp.async

Executable "async-hello-world"
Path: examples/async
MainIs: hello_world.ml
Build$: flag(async)
Custom: true
CompiledObject: best
Install: false
BuildDepends: cohttp, cohttp.async

Test test_accept
Run$: flag(tests)
Command: $test_accept
Expand Down

0 comments on commit bbf0b9c

Please sign in to comment.