Permalink
Browse files

upstream import of ocaml-http-0.1.3

  • Loading branch information...
avsm committed Sep 28, 2009
0 parents commit 16a9e46a248dfa71b0b041ae3c553920d6f4fab4
Showing with 13,567 additions and 0 deletions.
  1. +49 −0 .depend
  2. +37 −0 INSTALL
  3. +483 −0 LICENSE
  4. +8 −0 META.in
  5. +137 −0 Makefile
  6. +24 −0 Makefile.defs
  7. +4 −0 README
  8. +184 −0 debian/changelog
  9. +1 −0 debian/compat
  10. +23 −0 debian/control
  11. +23 −0 debian/control.in
  12. +15 −0 debian/copyright
  13. +1 −0 debian/dirs
  14. +1 −0 debian/dirs.in
  15. +12 −0 debian/doc-base
  16. +2 −0 debian/docs
  17. +1 −0 debian/examples
  18. +24 −0 debian/rules
  19. +2 −0 doc/html/.cvsignore
  20. +92 −0 doc/html/Http_common.html
  21. +53 −0 doc/html/Http_constants.html
  22. +46 −0 doc/html/Http_daemon.Trivial.html
  23. +40 −0 doc/html/Http_daemon.daemon.html
  24. +130 −0 doc/html/Http_daemon.html
  25. +43 −0 doc/html/Http_message.html
  26. +127 −0 doc/html/Http_message.message.html
  27. +111 −0 doc/html/Http_misc.html
  28. +81 −0 doc/html/Http_parser.html
  29. +61 −0 doc/html/Http_parser_sanity.html
  30. +43 −0 doc/html/Http_request.html
  31. +36 −0 doc/html/Http_request.request.html
  32. +43 −0 doc/html/Http_response.html
  33. +36 −0 doc/html/Http_response.response.html
  34. +60 −0 doc/html/Http_tcp_server.html
  35. +43 −0 doc/html/Http_threaded_tcp_server.html
  36. +51 −0 doc/html/Http_types.connection.html
  37. +46 −0 doc/html/Http_types.daemon.html
  38. +341 −0 doc/html/Http_types.html
  39. +38 −0 doc/html/Http_types.message.html
  40. +82 −0 doc/html/Http_types.request.html
  41. +120 −0 doc/html/Http_types.response.html
  42. +57 −0 doc/html/Http_user_agent.html
  43. +94 −0 doc/html/index.html
  44. +32 −0 doc/html/index_attributes.html
  45. +61 −0 doc/html/index_class_types.html
  46. +55 −0 doc/html/index_classes.html
  47. +127 −0 doc/html/index_exceptions.html
  48. +389 −0 doc/html/index_methods.html
  49. +32 −0 doc/html/index_module_types.html
  50. +105 −0 doc/html/index_modules.html
  51. +120 −0 doc/html/index_types.html
  52. +473 −0 doc/html/index_values.html
  53. +33 −0 doc/html/style.css
  54. +44 −0 doc/html/type_Http_common.html
  55. +40 −0 doc/html/type_Http_constants.html
  56. +30 −0 doc/html/type_Http_daemon.Trivial.html
  57. +27 −0 doc/html/type_Http_daemon.daemon.html
  58. +86 −0 doc/html/type_Http_daemon.html
  59. +61 −0 doc/html/type_Http_message.html
  60. +58 −0 doc/html/type_Http_message.message.html
  61. +48 −0 doc/html/type_Http_misc.html
  62. +39 −0 doc/html/type_Http_parser.html
  63. +34 −0 doc/html/type_Http_parser_sanity.html
  64. +27 −0 doc/html/type_Http_request.html
  65. +27 −0 doc/html/type_Http_request.request.html
  66. +35 −0 doc/html/type_Http_response.html
  67. +32 −0 doc/html/type_Http_response.response.html
  68. +32 −0 doc/html/type_Http_tcp_server.html
  69. +27 −0 doc/html/type_Http_threaded_tcp_server.html
  70. +31 −0 doc/html/type_Http_types.connection.html
  71. +30 −0 doc/html/type_Http_types.daemon.html
  72. +254 −0 doc/html/type_Http_types.html
  73. +52 −0 doc/html/type_Http_types.message.html
  74. +61 −0 doc/html/type_Http_types.request.html
  75. +77 −0 doc/html/type_Http_types.response.html
  76. +36 −0 doc/html/type_Http_user_agent.html
  77. BIN doc/modules.ps
  78. BIN doc/ocaml-http.ps
  79. +18 −0 examples/.cvsignore
  80. +41 −0 examples/Makefile
  81. +33 −0 examples/always_ok_daemon.ml
  82. +50 −0 examples/basic_auth.ml
  83. +34 −0 examples/chdir.ml
  84. +42 −0 examples/client_address.ml
  85. +51 −0 examples/damned_recursion.ml
  86. +48 −0 examples/dump_args.ml
  87. +41 −0 examples/highlander.ml
  88. +47 −0 examples/oo_daemon.ml
  89. +63 −0 examples/threads.ml
  90. +31 −0 examples/timeout.ml
  91. +50 −0 examples/webfsd.ml
  92. +162 −0 http_common.ml
  93. +80 −0 http_common.mli
  94. +36 −0 http_constants.ml
  95. +44 −0 http_constants.mli
  96. +473 −0 http_daemon.ml
  97. +186 −0 http_daemon.mli
  98. +118 −0 http_message.ml
  99. +130 −0 http_message.mli
  100. +154 −0 http_misc.ml
  101. +94 −0 http_misc.mli
  102. +160 −0 http_parser.ml
  103. +68 −0 http_parser.mli
  104. +115 −0 http_parser_sanity.ml
  105. +46 −0 http_parser_sanity.mli
  106. +145 −0 http_request.ml
  107. +29 −0 http_request.mli
  108. +118 −0 http_response.ml
  109. +33 −0 http_response.mli
  110. +172 −0 http_tcp_server.ml
  111. +39 −0 http_tcp_server.mli
  112. +26 −0 http_threaded_tcp_server.mli
  113. +220 −0 http_types.ml
  114. +455 −0 http_types.mli
  115. +101 −0 http_user_agent.ml
  116. +53 −0 http_user_agent.mli
  117. +6 −0 mt/.cvsignore
  118. +23 −0 mt/http_threaded_tcp_server.ml
  119. +1,494 −0 netencoding.ml
  120. +342 −0 netencoding.mli
  121. +1,709 −0 neturl.ml
  122. +635 −0 neturl.mli
  123. +6 −0 non_mt/.cvsignore
  124. +26 −0 non_mt/http_threaded_tcp_server.ml
49 .depend
@@ -0,0 +1,49 @@
+http_common.cmo: http_types.cmi http_constants.cmi http_common.cmi
+http_common.cmx: http_types.cmx http_constants.cmx http_common.cmi
+http_constants.cmo: http_constants.cmi
+http_constants.cmx: http_constants.cmi
+http_daemon.cmo: http_types.cmi http_tcp_server.cmi http_request.cmi \
+ http_parser_sanity.cmi http_parser.cmi http_misc.cmi http_constants.cmi \
+ http_common.cmi http_daemon.cmi
+http_daemon.cmx: http_types.cmx http_tcp_server.cmx http_request.cmx \
+ http_parser_sanity.cmx http_parser.cmx http_misc.cmx http_constants.cmx \
+ http_common.cmx http_daemon.cmi
+http_message.cmo: http_types.cmi http_parser_sanity.cmi http_misc.cmi \
+ http_constants.cmi http_common.cmi http_message.cmi
+http_message.cmx: http_types.cmx http_parser_sanity.cmx http_misc.cmx \
+ http_constants.cmx http_common.cmx http_message.cmi
+http_misc.cmo: http_types.cmi http_misc.cmi
+http_misc.cmx: http_types.cmx http_misc.cmi
+http_parser.cmo: http_types.cmi http_parser_sanity.cmi http_constants.cmi \
+ http_common.cmi http_parser.cmi
+http_parser.cmx: http_types.cmx http_parser_sanity.cmx http_constants.cmx \
+ http_common.cmx http_parser.cmi
+http_parser_sanity.cmo: http_types.cmi http_constants.cmi \
+ http_parser_sanity.cmi
+http_parser_sanity.cmx: http_types.cmx http_constants.cmx \
+ http_parser_sanity.cmi
+http_request.cmo: http_types.cmi http_parser.cmi http_misc.cmi \
+ http_message.cmi http_common.cmi http_request.cmi
+http_request.cmx: http_types.cmx http_parser.cmx http_misc.cmx \
+ http_message.cmx http_common.cmx http_request.cmi
+http_response.cmo: http_types.cmi http_misc.cmi http_message.cmi \
+ http_daemon.cmi http_constants.cmi http_common.cmi http_response.cmi
+http_response.cmx: http_types.cmx http_misc.cmx http_message.cmx \
+ http_daemon.cmx http_constants.cmx http_common.cmx http_response.cmi
+http_tcp_server.cmo: http_threaded_tcp_server.cmi http_tcp_server.cmi
+http_tcp_server.cmx: http_threaded_tcp_server.cmi http_tcp_server.cmi
+http_types.cmo: http_types.cmi
+http_types.cmx: http_types.cmi
+http_user_agent.cmo: http_parser.cmi http_misc.cmi http_common.cmi \
+ http_user_agent.cmi
+http_user_agent.cmx: http_parser.cmx http_misc.cmx http_common.cmx \
+ http_user_agent.cmi
+http_common.cmi: http_types.cmi
+http_constants.cmi: http_types.cmi
+http_daemon.cmi: http_types.cmi
+http_message.cmi: http_types.cmi
+http_parser.cmi: http_types.cmi
+http_request.cmi: http_types.cmi
+http_response.cmi: http_types.cmi
+http_tcp_server.cmi: http_types.cmi
+http_user_agent.cmi: http_types.cmi
37 INSTALL
@@ -0,0 +1,37 @@
+
+In order to build ocaml-http you will need:
+
+ - the ocaml compiler
+ [ http://caml.inria.fr ]
+
+ - findlib
+ [ http://www.ocaml-programming.de/packages/documentation/findlib/ ]
+
+ - ocamlnet
+ [ http://sourceforge.net/projects/ocamlnet ]
+
+ - pcre-ocaml
+ [ http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html ]
+
+To build the bytecode library:
+
+ $ make all
+
+To build the nativecode library (only if you have an ocaml native code
+compiler):
+
+ $ make opt
+
+To install the built stuff in the OCaml standard library directory (as root):
+
+ # make install
+
+To install the built stuff in another directory:
+
+ $ make install DESTDIR=another_directory
+
+To build a debian package of the library (please note that to build a debian
+package you will also need some additional stuff like debhelper, fakeroot, ...):
+
+ $ fakeroot debian/rules binary
+
483 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,8 @@
+description = "OCaml HTTP daemon library"
+version = "@DISTVERSION@"
+requires = "unix,pcre,netstring"
+requires(mt) = "unix,pcre,netstring,threads"
+archive(byte) = "http.cma"
+archive(native) = "http.cmxa"
+archive(mt,byte) = "http_mt.cma"
+archive(mt,native) = "http_mt.cmxa"
137 Makefile
@@ -0,0 +1,137 @@
+include Makefile.defs
+export SHELL=/bin/bash
+
+MODULES = \
+ http_constants http_types http_parser_sanity http_misc http_common \
+ http_tcp_server http_parser http_message http_request http_daemon \
+ http_response http_user_agent
+
+THREADED_SRV = http_threaded_tcp_server
+MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
+MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
+PUBLIC_MODULES = \
+ http_types \
+ http_common \
+ http_message \
+ http_request \
+ http_daemon \
+ http_response \
+ http_user_agent
+OCAMLDOC_STUFF = *.mli
+DOCDIR = doc/html
+DOTDIR = doc/dot
+TEXDIR = doc/latex
+DESTDIR = $(shell $(OCAMLFIND) printconf destdir)
+
+all: all_non_mt all_mt
+opt: opt_non_mt opt_mt
+all_non_mt: http.cma
+opt_non_mt: http.cmxa
+all_mt: http_mt.cma
+opt_mt: http_mt.cmxa
+world: all opt
+doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
+$(DOCDIR)/index.html:
+ $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
+$(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
+ $(OCAMLDOC) -latex -o $@ $^
+$(TEXDIR)/ocaml-http.ps: $(TEXDIR)/ocaml-http.tex
+ cd $(TEXDIR); \
+ latex ocaml-http; \
+ latex ocaml-http; \
+ dvips ocaml-http
+$(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
+ $(DOT) -Tps $< > $@
+$(DOTDIR)/ocaml-http.dot: *.ml *.mli
+ $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
+
+examples:
+ $(MAKE) -C examples/
+examples.opt:
+ $(MAKE) -C examples/ opt
+
+include .depend
+
+depend:
+ $(OCAMLDEP) *.ml *.mli > .depend
+
+%.cmi: %.mli
+ $(OCAMLC) -c $<
+%.cmo: %.ml %.cmi
+ $(OCAMLC) -c $<
+%.cmx: %.ml %.cmi
+ $(OCAMLOPT) -c $<
+
+non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
+ cp $(THREADED_SRV).{cmi,mli} non_mt/
+ $(OCAMLC) -c $<
+non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
+ cp $(THREADED_SRV).{cmi,mli} non_mt/
+ $(OCAMLOPT) -c $<
+
+mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
+ cp $(THREADED_SRV).{cmi,mli} mt/
+ $(OCAMLC) $(THREADS_FLAGS) -c $<
+mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
+ cp $(THREADED_SRV).{cmi,mli} mt/
+ $(OCAMLOPT) $(THREADS_FLAGS) -c $<
+
+http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
+ $(OCAMLC) -a -o $@ $^
+http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
+ $(OCAMLOPT) -a -o $@ $^
+http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
+ $(OCAMLC) -a -o $@ $^
+http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
+ $(OCAMLOPT) -a -o $@ $^
+
+meta: META
+META: META.in
+ cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
+
+clean:
+ $(MAKE) -C examples/ clean
+ for d in . mt non_mt; do \
+ rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
+ done
+ rm -f {mt,non_mt}/$(THREADED_SRV).mli
+docclean:
+ -rm -f \
+ $(DOCDIR)/*.html $(DOCDIR)/*.css \
+ $(DOTDIR)/*.dot $(DOTDIR)/*.ps \
+ $(TEXDIR)/*.{dvi,ps,ps.gz,pdf,aux,log,out,toc,tmp,haux,sty,tex}
+distclean: clean
+ $(MAKE) -C examples/ distclean
+ rm -f META
+dist: distreal distrm
+distdoc: all doc
+ if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
+ mkdir -p $(DISTDIR)/doc/
+ cp -r doc/html/ $(DISTDIR)/doc/
+ cp doc/dot/ocaml-http.ps $(DISTDIR)/doc/modules.ps
+ cp doc/latex/ocaml-http.ps $(DISTDIR)/doc/
+distreal: distdoc distclean depend
+ for f in \
+ $(patsubst %, %.ml, $(MODULES)) \
+ $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
+ mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
+ do \
+ cp -r $$f $(DISTDIR)/; \
+ done
+ -find $(DISTDIR)/ -type d -name .svn -exec rm -rf {} \;
+ tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
+distrm:
+ rm -rf $(DISTDIR)/
+deb: docclean distreal
+ (cd $(DISTDIR)/ && debuild)
+ rm -rf $(DISTDIR)/
+install: META
+ $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
+ $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
+ $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
+ $(wildcard *.cma *.cmxa *.a) META
+
+.PHONY: \
+ all opt world all_non_mt all_mt opt_non_mt opt_mt \
+ examples examples.opt depend clean distclean dist \
+ install meta doc deb distreal distrm
@@ -0,0 +1,24 @@
+PKGNAME = http
+DISTVERSION = $(shell dpkg-parsechangelog | egrep '^Version: ' | sed 's/^Version: //' | sed 's/-.*//')
+
+DEBUG_FLAGS =
+REQUIRES = unix str pcre netstring
+COMMON_FLAGS = $(DEBUG_FLAGS) -pp camlp4o -package "$(REQUIRES)"
+THREADS_FLAGS = -package threads -thread
+OCAMLFIND = ocamlfind
+OCAMLC = $(OCAMLFIND) ocamlc $(COMMON_FLAGS)
+OCAMLOPT = $(OCAMLFIND) ocamlopt $(COMMON_FLAGS)
+OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMON_FLAGS)
+OCAMLDOC := \
+ ocamldoc -stars \
+ $(shell $(OCAMLFIND) query -i-format unix) \
+ $(shell $(OCAMLFIND) query -i-format pcre) \
+ $(shell $(OCAMLFIND) query -i-format netstring)
+DOT = dot
+
+DISTNAME = ocaml-http
+DISTDIR = $(DISTNAME)-$(DISTVERSION)
+EXTRA_DIST = \
+ INSTALL LICENSE README META.in Makefile Makefile.defs \
+ .depend
+
4 README
@@ -0,0 +1,4 @@
+
+OCaml HTTP is a simple OCaml library for creating HTTP daemons, it is largely
+inspired to the Perl's HTTP:: modules family.
+
Oops, something went wrong.

0 comments on commit 16a9e46

Please sign in to comment.