Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

upstream import of ocaml-http-0.1.3

  • Loading branch information...
commit 16a9e46a248dfa71b0b041ae3c553920d6f4fab4 0 parents
Anil Madhavapeddy authored

Showing 124 changed files with 19,290 additions and 0 deletions. Show diff stats Hide diff stats

  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. +1,193 0 doc/modules.ps
  78. +4,530 0 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 @@
  1 +http_common.cmo: http_types.cmi http_constants.cmi http_common.cmi
  2 +http_common.cmx: http_types.cmx http_constants.cmx http_common.cmi
  3 +http_constants.cmo: http_constants.cmi
  4 +http_constants.cmx: http_constants.cmi
  5 +http_daemon.cmo: http_types.cmi http_tcp_server.cmi http_request.cmi \
  6 + http_parser_sanity.cmi http_parser.cmi http_misc.cmi http_constants.cmi \
  7 + http_common.cmi http_daemon.cmi
  8 +http_daemon.cmx: http_types.cmx http_tcp_server.cmx http_request.cmx \
  9 + http_parser_sanity.cmx http_parser.cmx http_misc.cmx http_constants.cmx \
  10 + http_common.cmx http_daemon.cmi
  11 +http_message.cmo: http_types.cmi http_parser_sanity.cmi http_misc.cmi \
  12 + http_constants.cmi http_common.cmi http_message.cmi
  13 +http_message.cmx: http_types.cmx http_parser_sanity.cmx http_misc.cmx \
  14 + http_constants.cmx http_common.cmx http_message.cmi
  15 +http_misc.cmo: http_types.cmi http_misc.cmi
  16 +http_misc.cmx: http_types.cmx http_misc.cmi
  17 +http_parser.cmo: http_types.cmi http_parser_sanity.cmi http_constants.cmi \
  18 + http_common.cmi http_parser.cmi
  19 +http_parser.cmx: http_types.cmx http_parser_sanity.cmx http_constants.cmx \
  20 + http_common.cmx http_parser.cmi
  21 +http_parser_sanity.cmo: http_types.cmi http_constants.cmi \
  22 + http_parser_sanity.cmi
  23 +http_parser_sanity.cmx: http_types.cmx http_constants.cmx \
  24 + http_parser_sanity.cmi
  25 +http_request.cmo: http_types.cmi http_parser.cmi http_misc.cmi \
  26 + http_message.cmi http_common.cmi http_request.cmi
  27 +http_request.cmx: http_types.cmx http_parser.cmx http_misc.cmx \
  28 + http_message.cmx http_common.cmx http_request.cmi
  29 +http_response.cmo: http_types.cmi http_misc.cmi http_message.cmi \
  30 + http_daemon.cmi http_constants.cmi http_common.cmi http_response.cmi
  31 +http_response.cmx: http_types.cmx http_misc.cmx http_message.cmx \
  32 + http_daemon.cmx http_constants.cmx http_common.cmx http_response.cmi
  33 +http_tcp_server.cmo: http_threaded_tcp_server.cmi http_tcp_server.cmi
  34 +http_tcp_server.cmx: http_threaded_tcp_server.cmi http_tcp_server.cmi
  35 +http_types.cmo: http_types.cmi
  36 +http_types.cmx: http_types.cmi
  37 +http_user_agent.cmo: http_parser.cmi http_misc.cmi http_common.cmi \
  38 + http_user_agent.cmi
  39 +http_user_agent.cmx: http_parser.cmx http_misc.cmx http_common.cmx \
  40 + http_user_agent.cmi
  41 +http_common.cmi: http_types.cmi
  42 +http_constants.cmi: http_types.cmi
  43 +http_daemon.cmi: http_types.cmi
  44 +http_message.cmi: http_types.cmi
  45 +http_parser.cmi: http_types.cmi
  46 +http_request.cmi: http_types.cmi
  47 +http_response.cmi: http_types.cmi
  48 +http_tcp_server.cmi: http_types.cmi
  49 +http_user_agent.cmi: http_types.cmi
37 INSTALL
... ... @@ -0,0 +1,37 @@
  1 +
  2 +In order to build ocaml-http you will need:
  3 +
  4 + - the ocaml compiler
  5 + [ http://caml.inria.fr ]
  6 +
  7 + - findlib
  8 + [ http://www.ocaml-programming.de/packages/documentation/findlib/ ]
  9 +
  10 + - ocamlnet
  11 + [ http://sourceforge.net/projects/ocamlnet ]
  12 +
  13 + - pcre-ocaml
  14 + [ http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html ]
  15 +
  16 +To build the bytecode library:
  17 +
  18 + $ make all
  19 +
  20 +To build the nativecode library (only if you have an ocaml native code
  21 +compiler):
  22 +
  23 + $ make opt
  24 +
  25 +To install the built stuff in the OCaml standard library directory (as root):
  26 +
  27 + # make install
  28 +
  29 +To install the built stuff in another directory:
  30 +
  31 + $ make install DESTDIR=another_directory
  32 +
  33 +To build a debian package of the library (please note that to build a debian
  34 +package you will also need some additional stuff like debhelper, fakeroot, ...):
  35 +
  36 + $ fakeroot debian/rules binary
  37 +
483 LICENSE
... ... @@ -0,0 +1,483 @@
  1 +
  2 + GNU LIBRARY GENERAL PUBLIC LICENSE
  3 + Version 2, June 1991
  4 +
  5 + Copyright (C) 1991 Free Software Foundation, Inc.
  6 + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  7 + Everyone is permitted to copy and distribute verbatim copies
  8 + of this license document, but changing it is not allowed.
  9 +
  10 +[This is the first released version of the library GPL. It is
  11 + numbered 2 because it goes with version 2 of the ordinary GPL.]
  12 +
  13 + Preamble
  14 +
  15 + The licenses for most software are designed to take away your
  16 +freedom to share and change it. By contrast, the GNU General Public
  17 +Licenses are intended to guarantee your freedom to share and change
  18 +free software--to make sure the software is free for all its users.
  19 +
  20 + This license, the Library General Public License, applies to some
  21 +specially designated Free Software Foundation software, and to any
  22 +other libraries whose authors decide to use it. You can use it for
  23 +your libraries, too.
  24 +
  25 + When we speak of free software, we are referring to freedom, not
  26 +price. Our General Public Licenses are designed to make sure that you
  27 +have the freedom to distribute copies of free software (and charge for
  28 +this service if you wish), that you receive source code or can get it
  29 +if you want it, that you can change the software or use pieces of it
  30 +in new free programs; and that you know you can do these things.
  31 +
  32 + To protect your rights, we need to make restrictions that forbid
  33 +anyone to deny you these rights or to ask you to surrender the rights.
  34 +These restrictions translate to certain responsibilities for you if
  35 +you distribute copies of the library, or if you modify it.
  36 +
  37 + For example, if you distribute copies of the library, whether gratis
  38 +or for a fee, you must give the recipients all the rights that we gave
  39 +you. You must make sure that they, too, receive or can get the source
  40 +code. If you link a program with the library, you must provide
  41 +complete object files to the recipients so that they can relink them
  42 +with the library, after making changes to the library and recompiling
  43 +it. And you must show them these terms so they know their rights.
  44 +
  45 + Our method of protecting your rights has two steps: (1) copyright
  46 +the library, and (2) offer you this license which gives you legal
  47 +permission to copy, distribute and/or modify the library.
  48 +
  49 + Also, for each distributor's protection, we want to make certain
  50 +that everyone understands that there is no warranty for this free
  51 +library. If the library is modified by someone else and passed on, we
  52 +want its recipients to know that what they have is not the original
  53 +version, so that any problems introduced by others will not reflect on
  54 +the original authors' reputations.
  55 +
  56 + Finally, any free program is threatened constantly by software
  57 +patents. We wish to avoid the danger that companies distributing free
  58 +software will individually obtain patent licenses, thus in effect
  59 +transforming the program into proprietary software. To prevent this,
  60 +we have made it clear that any patent must be licensed for everyone's
  61 +free use or not licensed at all.
  62 +
  63 + Most GNU software, including some libraries, is covered by the ordinary
  64 +GNU General Public License, which was designed for utility programs. This
  65 +license, the GNU Library General Public License, applies to certain
  66 +designated libraries. This license is quite different from the ordinary
  67 +one; be sure to read it in full, and don't assume that anything in it is
  68 +the same as in the ordinary license.
  69 +
  70 + The reason we have a separate public license for some libraries is that
  71 +they blur the distinction we usually make between modifying or adding to a
  72 +program and simply using it. Linking a program with a library, without
  73 +changing the library, is in some sense simply using the library, and is
  74 +analogous to running a utility program or application program. However, in
  75 +a textual and legal sense, the linked executable is a combined work, a
  76 +derivative of the original library, and the ordinary General Public License
  77 +treats it as such.
  78 +
  79 + Because of this blurred distinction, using the ordinary General
  80 +Public License for libraries did not effectively promote software
  81 +sharing, because most developers did not use the libraries. We
  82 +concluded that weaker conditions might promote sharing better.
  83 +
  84 + However, unrestricted linking of non-free programs would deprive the
  85 +users of those programs of all benefit from the free status of the
  86 +libraries themselves. This Library General Public License is intended to
  87 +permit developers of non-free programs to use free libraries, while
  88 +preserving your freedom as a user of such programs to change the free
  89 +libraries that are incorporated in them. (We have not seen how to achieve
  90 +this as regards changes in header files, but we have achieved it as regards
  91 +changes in the actual functions of the Library.) The hope is that this
  92 +will lead to faster development of free libraries.
  93 +
  94 + The precise terms and conditions for copying, distribution and
  95 +modification follow. Pay close attention to the difference between a
  96 +"work based on the library" and a "work that uses the library". The
  97 +former contains code derived from the library, while the latter only
  98 +works together with the library.
  99 +
  100 + Note that it is possible for a library to be covered by the ordinary
  101 +General Public License rather than by this special one.
  102 +
  103 + GNU LIBRARY GENERAL PUBLIC LICENSE
  104 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  105 +
  106 + 0. This License Agreement applies to any software library which
  107 +contains a notice placed by the copyright holder or other authorized
  108 +party saying it may be distributed under the terms of this Library
  109 +General Public License (also called "this License"). Each licensee is
  110 +addressed as "you".
  111 +
  112 + A "library" means a collection of software functions and/or data
  113 +prepared so as to be conveniently linked with application programs
  114 +(which use some of those functions and data) to form executables.
  115 +
  116 + The "Library", below, refers to any such software library or work
  117 +which has been distributed under these terms. A "work based on the
  118 +Library" means either the Library or any derivative work under
  119 +copyright law: that is to say, a work containing the Library or a
  120 +portion of it, either verbatim or with modifications and/or translated
  121 +straightforwardly into another language. (Hereinafter, translation is
  122 +included without limitation in the term "modification".)
  123 +
  124 + "Source code" for a work means the preferred form of the work for
  125 +making modifications to it. For a library, complete source code means
  126 +all the source code for all modules it contains, plus any associated
  127 +interface definition files, plus the scripts used to control compilation
  128 +and installation of the library.
  129 +
  130 + Activities other than copying, distribution and modification are not
  131 +covered by this License; they are outside its scope. The act of
  132 +running a program using the Library is not restricted, and output from
  133 +such a program is covered only if its contents constitute a work based
  134 +on the Library (independent of the use of the Library in a tool for
  135 +writing it). Whether that is true depends on what the Library does
  136 +and what the program that uses the Library does.
  137 +
  138 + 1. You may copy and distribute verbatim copies of the Library's
  139 +complete source code as you receive it, in any medium, provided that
  140 +you conspicuously and appropriately publish on each copy an
  141 +appropriate copyright notice and disclaimer of warranty; keep intact
  142 +all the notices that refer to this License and to the absence of any
  143 +warranty; and distribute a copy of this License along with the
  144 +Library.
  145 +
  146 + You may charge a fee for the physical act of transferring a copy,
  147 +and you may at your option offer warranty protection in exchange for a
  148 +fee.
  149 +
  150 + 2. You may modify your copy or copies of the Library or any portion
  151 +of it, thus forming a work based on the Library, and copy and
  152 +distribute such modifications or work under the terms of Section 1
  153 +above, provided that you also meet all of these conditions:
  154 +
  155 + a) The modified work must itself be a software library.
  156 +
  157 + b) You must cause the files modified to carry prominent notices
  158 + stating that you changed the files and the date of any change.
  159 +
  160 + c) You must cause the whole of the work to be licensed at no
  161 + charge to all third parties under the terms of this License.
  162 +
  163 + d) If a facility in the modified Library refers to a function or a
  164 + table of data to be supplied by an application program that uses
  165 + the facility, other than as an argument passed when the facility
  166 + is invoked, then you must make a good faith effort to ensure that,
  167 + in the event an application does not supply such function or
  168 + table, the facility still operates, and performs whatever part of
  169 + its purpose remains meaningful.
  170 +
  171 + (For example, a function in a library to compute square roots has
  172 + a purpose that is entirely well-defined independent of the
  173 + application. Therefore, Subsection 2d requires that any
  174 + application-supplied function or table used by this function must
  175 + be optional: if the application does not supply it, the square
  176 + root function must still compute square roots.)
  177 +
  178 +These requirements apply to the modified work as a whole. If
  179 +identifiable sections of that work are not derived from the Library,
  180 +and can be reasonably considered independent and separate works in
  181 +themselves, then this License, and its terms, do not apply to those
  182 +sections when you distribute them as separate works. But when you
  183 +distribute the same sections as part of a whole which is a work based
  184 +on the Library, the distribution of the whole must be on the terms of
  185 +this License, whose permissions for other licensees extend to the
  186 +entire whole, and thus to each and every part regardless of who wrote
  187 +it.
  188 +
  189 +Thus, it is not the intent of this section to claim rights or contest
  190 +your rights to work written entirely by you; rather, the intent is to
  191 +exercise the right to control the distribution of derivative or
  192 +collective works based on the Library.
  193 +
  194 +In addition, mere aggregation of another work not based on the Library
  195 +with the Library (or with a work based on the Library) on a volume of
  196 +a storage or distribution medium does not bring the other work under
  197 +the scope of this License.
  198 +
  199 + 3. You may opt to apply the terms of the ordinary GNU General Public
  200 +License instead of this License to a given copy of the Library. To do
  201 +this, you must alter all the notices that refer to this License, so
  202 +that they refer to the ordinary GNU General Public License, version 2,
  203 +instead of to this License. (If a newer version than version 2 of the
  204 +ordinary GNU General Public License has appeared, then you can specify
  205 +that version instead if you wish.) Do not make any other change in
  206 +these notices.
  207 +
  208 + Once this change is made in a given copy, it is irreversible for
  209 +that copy, so the ordinary GNU General Public License applies to all
  210 +subsequent copies and derivative works made from that copy.
  211 +
  212 + This option is useful when you wish to copy part of the code of
  213 +the Library into a program that is not a library.
  214 +
  215 + 4. You may copy and distribute the Library (or a portion or
  216 +derivative of it, under Section 2) in object code or executable form
  217 +under the terms of Sections 1 and 2 above provided that you accompany
  218 +it with the complete corresponding machine-readable source code, which
  219 +must be distributed under the terms of Sections 1 and 2 above on a
  220 +medium customarily used for software interchange.
  221 +
  222 + If distribution of object code is made by offering access to copy
  223 +from a designated place, then offering equivalent access to copy the
  224 +source code from the same place satisfies the requirement to
  225 +distribute the source code, even though third parties are not
  226 +compelled to copy the source along with the object code.
  227 +
  228 + 5. A program that contains no derivative of any portion of the
  229 +Library, but is designed to work with the Library by being compiled or
  230 +linked with it, is called a "work that uses the Library". Such a
  231 +work, in isolation, is not a derivative work of the Library, and
  232 +therefore falls outside the scope of this License.
  233 +
  234 + However, linking a "work that uses the Library" with the Library
  235 +creates an executable that is a derivative of the Library (because it
  236 +contains portions of the Library), rather than a "work that uses the
  237 +library". The executable is therefore covered by this License.
  238 +Section 6 states terms for distribution of such executables.
  239 +
  240 + When a "work that uses the Library" uses material from a header file
  241 +that is part of the Library, the object code for the work may be a
  242 +derivative work of the Library even though the source code is not.
  243 +Whether this is true is especially significant if the work can be
  244 +linked without the Library, or if the work is itself a library. The
  245 +threshold for this to be true is not precisely defined by law.
  246 +
  247 + If such an object file uses only numerical parameters, data
  248 +structure layouts and accessors, and small macros and small inline
  249 +functions (ten lines or less in length), then the use of the object
  250 +file is unrestricted, regardless of whether it is legally a derivative
  251 +work. (Executables containing this object code plus portions of the
  252 +Library will still fall under Section 6.)
  253 +
  254 + Otherwise, if the work is a derivative of the Library, you may
  255 +distribute the object code for the work under the terms of Section 6.
  256 +Any executables containing that work also fall under Section 6,
  257 +whether or not they are linked directly with the Library itself.
  258 +
  259 + 6. As an exception to the Sections above, you may also compile or
  260 +link a "work that uses the Library" with the Library to produce a
  261 +work containing portions of the Library, and distribute that work
  262 +under terms of your choice, provided that the terms permit
  263 +modification of the work for the customer's own use and reverse
  264 +engineering for debugging such modifications.
  265 +
  266 + You must give prominent notice with each copy of the work that the
  267 +Library is used in it and that the Library and its use are covered by
  268 +this License. You must supply a copy of this License. If the work
  269 +during execution displays copyright notices, you must include the
  270 +copyright notice for the Library among them, as well as a reference
  271 +directing the user to the copy of this License. Also, you must do one
  272 +of these things:
  273 +
  274 + a) Accompany the work with the complete corresponding
  275 + machine-readable source code for the Library including whatever
  276 + changes were used in the work (which must be distributed under
  277 + Sections 1 and 2 above); and, if the work is an executable linked
  278 + with the Library, with the complete machine-readable "work that
  279 + uses the Library", as object code and/or source code, so that the
  280 + user can modify the Library and then relink to produce a modified
  281 + executable containing the modified Library. (It is understood
  282 + that the user who changes the contents of definitions files in the
  283 + Library will not necessarily be able to recompile the application
  284 + to use the modified definitions.)
  285 +
  286 + b) Accompany the work with a written offer, valid for at
  287 + least three years, to give the same user the materials
  288 + specified in Subsection 6a, above, for a charge no more
  289 + than the cost of performing this distribution.
  290 +
  291 + c) If distribution of the work is made by offering access to copy
  292 + from a designated place, offer equivalent access to copy the above
  293 + specified materials from the same place.
  294 +
  295 + d) Verify that the user has already received a copy of these
  296 + materials or that you have already sent this user a copy.
  297 +
  298 + For an executable, the required form of the "work that uses the
  299 +Library" must include any data and utility programs needed for
  300 +reproducing the executable from it. However, as a special exception,
  301 +the source code distributed need not include anything that is normally
  302 +distributed (in either source or binary form) with the major
  303 +components (compiler, kernel, and so on) of the operating system on
  304 +which the executable runs, unless that component itself accompanies
  305 +the executable.
  306 +
  307 + It may happen that this requirement contradicts the license
  308 +restrictions of other proprietary libraries that do not normally
  309 +accompany the operating system. Such a contradiction means you cannot
  310 +use both them and the Library together in an executable that you
  311 +distribute.
  312 +
  313 + 7. You may place library facilities that are a work based on the
  314 +Library side-by-side in a single library together with other library
  315 +facilities not covered by this License, and distribute such a combined
  316 +library, provided that the separate distribution of the work based on
  317 +the Library and of the other library facilities is otherwise
  318 +permitted, and provided that you do these two things:
  319 +
  320 + a) Accompany the combined library with a copy of the same work
  321 + based on the Library, uncombined with any other library
  322 + facilities. This must be distributed under the terms of the
  323 + Sections above.
  324 +
  325 + b) Give prominent notice with the combined library of the fact
  326 + that part of it is a work based on the Library, and explaining
  327 + where to find the accompanying uncombined form of the same work.
  328 +
  329 + 8. You may not copy, modify, sublicense, link with, or distribute
  330 +the Library except as expressly provided under this License. Any
  331 +attempt otherwise to copy, modify, sublicense, link with, or
  332 +distribute the Library is void, and will automatically terminate your
  333 +rights under this License. However, parties who have received copies,
  334 +or rights, from you under this License will not have their licenses
  335 +terminated so long as such parties remain in full compliance.
  336 +
  337 + 9. You are not required to accept this License, since you have not
  338 +signed it. However, nothing else grants you permission to modify or
  339 +distribute the Library or its derivative works. These actions are
  340 +prohibited by law if you do not accept this License. Therefore, by
  341 +modifying or distributing the Library (or any work based on the
  342 +Library), you indicate your acceptance of this License to do so, and
  343 +all its terms and conditions for copying, distributing or modifying
  344 +the Library or works based on it.
  345 +
  346 + 10. Each time you redistribute the Library (or any work based on the
  347 +Library), the recipient automatically receives a license from the
  348 +original licensor to copy, distribute, link with or modify the Library
  349 +subject to these terms and conditions. You may not impose any further
  350 +restrictions on the recipients' exercise of the rights granted herein.
  351 +You are not responsible for enforcing compliance by third parties to
  352 +this License.
  353 +
  354 + 11. If, as a consequence of a court judgment or allegation of patent
  355 +infringement or for any other reason (not limited to patent issues),
  356 +conditions are imposed on you (whether by court order, agreement or
  357 +otherwise) that contradict the conditions of this License, they do not
  358 +excuse you from the conditions of this License. If you cannot
  359 +distribute so as to satisfy simultaneously your obligations under this
  360 +License and any other pertinent obligations, then as a consequence you
  361 +may not distribute the Library at all. For example, if a patent
  362 +license would not permit royalty-free redistribution of the Library by
  363 +all those who receive copies directly or indirectly through you, then
  364 +the only way you could satisfy both it and this License would be to
  365 +refrain entirely from distribution of the Library.
  366 +
  367 +If any portion of this section is held invalid or unenforceable under any
  368 +particular circumstance, the balance of the section is intended to apply,
  369 +and the section as a whole is intended to apply in other circumstances.
  370 +
  371 +It is not the purpose of this section to induce you to infringe any
  372 +patents or other property right claims or to contest validity of any
  373 +such claims; this section has the sole purpose of protecting the
  374 +integrity of the free software distribution system which is
  375 +implemented by public license practices. Many people have made
  376 +generous contributions to the wide range of software distributed
  377 +through that system in reliance on consistent application of that
  378 +system; it is up to the author/donor to decide if he or she is willing
  379 +to distribute software through any other system and a licensee cannot
  380 +impose that choice.
  381 +
  382 +This section is intended to make thoroughly clear what is believed to
  383 +be a consequence of the rest of this License.
  384 +
  385 + 12. If the distribution and/or use of the Library is restricted in
  386 +certain countries either by patents or by copyrighted interfaces, the
  387 +original copyright holder who places the Library under this License may add
  388 +an explicit geographical distribution limitation excluding those countries,
  389 +so that distribution is permitted only in or among countries not thus
  390 +excluded. In such case, this License incorporates the limitation as if
  391 +written in the body of this License.
  392 +
  393 + 13. The Free Software Foundation may publish revised and/or new
  394 +versions of the Library General Public License from time to time.
  395 +Such new versions will be similar in spirit to the present version,
  396 +but may differ in detail to address new problems or concerns.
  397 +
  398 +Each version is given a distinguishing version number. If the Library
  399 +specifies a version number of this License which applies to it and
  400 +"any later version", you have the option of following the terms and
  401 +conditions either of that version or of any later version published by
  402 +the Free Software Foundation. If the Library does not specify a
  403 +license version number, you may choose any version ever published by
  404 +the Free Software Foundation.
  405 +
  406 + 14. If you wish to incorporate parts of the Library into other free
  407 +programs whose distribution conditions are incompatible with these,
  408 +write to the author to ask for permission. For software which is
  409 +copyrighted by the Free Software Foundation, write to the Free
  410 +Software Foundation; we sometimes make exceptions for this. Our
  411 +decision will be guided by the two goals of preserving the free status
  412 +of all derivatives of our free software and of promoting the sharing
  413 +and reuse of software generally.
  414 +
  415 + NO WARRANTY
  416 +
  417 + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  418 +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
  419 +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
  420 +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
  421 +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  422 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  423 +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  424 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
  425 +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  426 +
  427 + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  428 +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
  429 +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
  430 +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  431 +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
  432 +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
  433 +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
  434 +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
  435 +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  436 +DAMAGES.
  437 +
  438 + END OF TERMS AND CONDITIONS
  439 +
  440 + How to Apply These Terms to Your New Libraries
  441 +
  442 + If you develop a new library, and you want it to be of the greatest
  443 +possible use to the public, we recommend making it free software that
  444 +everyone can redistribute and change. You can do so by permitting
  445 +redistribution under these terms (or, alternatively, under the terms of the
  446 +ordinary General Public License).
  447 +
  448 + To apply these terms, attach the following notices to the library. It is
  449 +safest to attach them to the start of each source file to most effectively
  450 +convey the exclusion of warranty; and each file should have at least the
  451 +"copyright" line and a pointer to where the full notice is found.
  452 +
  453 + <one line to give the library's name and a brief idea of what it does.>
  454 + Copyright (C) <year> <name of author>
  455 +
  456 + This library is free software; you can redistribute it and/or
  457 + modify it under the terms of the GNU Library General Public
  458 + License as published by the Free Software Foundation; either
  459 + version 2 of the License, or (at your option) any later version.
  460 +
  461 + This library is distributed in the hope that it will be useful,
  462 + but WITHOUT ANY WARRANTY; without even the implied warranty of
  463 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  464 + Library General Public License for more details.
  465 +
  466 + You should have received a copy of the GNU Library General Public
  467 + License along with this library; if not, write to the Free Software
  468 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  469 +
  470 +Also add information on how to contact you by electronic and paper mail.
  471 +
  472 +You should also get your employer (if you work as a programmer) or your
  473 +school, if any, to sign a "copyright disclaimer" for the library, if
  474 +necessary. Here is a sample; alter the names:
  475 +
  476 + Yoyodyne, Inc., hereby disclaims all copyright interest in the
  477 + library `Frob' (a library for tweaking knobs) written by James Random Hacker.
  478 +
  479 + <signature of Ty Coon>, 1 April 1990
  480 + Ty Coon, President of Vice
  481 +
  482 +That's all there is to it!
  483 +
8 META.in
... ... @@ -0,0 +1,8 @@
  1 +description = "OCaml HTTP daemon library"
  2 +version = "@DISTVERSION@"
  3 +requires = "unix,pcre,netstring"
  4 +requires(mt) = "unix,pcre,netstring,threads"
  5 +archive(byte) = "http.cma"
  6 +archive(native) = "http.cmxa"
  7 +archive(mt,byte) = "http_mt.cma"
  8 +archive(mt,native) = "http_mt.cmxa"
137 Makefile
... ... @@ -0,0 +1,137 @@
  1 +include Makefile.defs
  2 +export SHELL=/bin/bash
  3 +
  4 +MODULES = \
  5 + http_constants http_types http_parser_sanity http_misc http_common \
  6 + http_tcp_server http_parser http_message http_request http_daemon \
  7 + http_response http_user_agent
  8 +
  9 +THREADED_SRV = http_threaded_tcp_server
  10 +MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
  11 +MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
  12 +PUBLIC_MODULES = \
  13 + http_types \
  14 + http_common \
  15 + http_message \
  16 + http_request \
  17 + http_daemon \
  18 + http_response \
  19 + http_user_agent
  20 +OCAMLDOC_STUFF = *.mli
  21 +DOCDIR = doc/html
  22 +DOTDIR = doc/dot
  23 +TEXDIR = doc/latex
  24 +DESTDIR = $(shell $(OCAMLFIND) printconf destdir)
  25 +
  26 +all: all_non_mt all_mt
  27 +opt: opt_non_mt opt_mt
  28 +all_non_mt: http.cma
  29 +opt_non_mt: http.cmxa
  30 +all_mt: http_mt.cma
  31 +opt_mt: http_mt.cmxa
  32 +world: all opt
  33 +doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
  34 +$(DOCDIR)/index.html:
  35 + $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
  36 +$(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
  37 + $(OCAMLDOC) -latex -o $@ $^
  38 +$(TEXDIR)/ocaml-http.ps: $(TEXDIR)/ocaml-http.tex
  39 + cd $(TEXDIR); \
  40 + latex ocaml-http; \
  41 + latex ocaml-http; \
  42 + dvips ocaml-http
  43 +$(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
  44 + $(DOT) -Tps $< > $@
  45 +$(DOTDIR)/ocaml-http.dot: *.ml *.mli
  46 + $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
  47 +
  48 +examples:
  49 + $(MAKE) -C examples/
  50 +examples.opt:
  51 + $(MAKE) -C examples/ opt
  52 +
  53 +include .depend
  54 +
  55 +depend:
  56 + $(OCAMLDEP) *.ml *.mli > .depend
  57 +
  58 +%.cmi: %.mli
  59 + $(OCAMLC) -c $<
  60 +%.cmo: %.ml %.cmi
  61 + $(OCAMLC) -c $<
  62 +%.cmx: %.ml %.cmi
  63 + $(OCAMLOPT) -c $<
  64 +
  65 +non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
  66 + cp $(THREADED_SRV).{cmi,mli} non_mt/
  67 + $(OCAMLC) -c $<
  68 +non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
  69 + cp $(THREADED_SRV).{cmi,mli} non_mt/
  70 + $(OCAMLOPT) -c $<
  71 +
  72 +mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
  73 + cp $(THREADED_SRV).{cmi,mli} mt/
  74 + $(OCAMLC) $(THREADS_FLAGS) -c $<
  75 +mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
  76 + cp $(THREADED_SRV).{cmi,mli} mt/
  77 + $(OCAMLOPT) $(THREADS_FLAGS) -c $<
  78 +
  79 +http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
  80 + $(OCAMLC) -a -o $@ $^
  81 +http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
  82 + $(OCAMLOPT) -a -o $@ $^
  83 +http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
  84 + $(OCAMLC) -a -o $@ $^
  85 +http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
  86 + $(OCAMLOPT) -a -o $@ $^
  87 +
  88 +meta: META
  89 +META: META.in
  90 + cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
  91 +
  92 +clean:
  93 + $(MAKE) -C examples/ clean
  94 + for d in . mt non_mt; do \
  95 + rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
  96 + done
  97 + rm -f {mt,non_mt}/$(THREADED_SRV).mli
  98 +docclean:
  99 + -rm -f \
  100 + $(DOCDIR)/*.html $(DOCDIR)/*.css \
  101 + $(DOTDIR)/*.dot $(DOTDIR)/*.ps \
  102 + $(TEXDIR)/*.{dvi,ps,ps.gz,pdf,aux,log,out,toc,tmp,haux,sty,tex}
  103 +distclean: clean
  104 + $(MAKE) -C examples/ distclean
  105 + rm -f META
  106 +dist: distreal distrm
  107 +distdoc: all doc
  108 + if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
  109 + mkdir -p $(DISTDIR)/doc/
  110 + cp -r doc/html/ $(DISTDIR)/doc/
  111 + cp doc/dot/ocaml-http.ps $(DISTDIR)/doc/modules.ps
  112 + cp doc/latex/ocaml-http.ps $(DISTDIR)/doc/
  113 +distreal: distdoc distclean depend
  114 + for f in \
  115 + $(patsubst %, %.ml, $(MODULES)) \
  116 + $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
  117 + mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
  118 + do \
  119 + cp -r $$f $(DISTDIR)/; \
  120 + done
  121 + -find $(DISTDIR)/ -type d -name .svn -exec rm -rf {} \;
  122 + tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
  123 +distrm:
  124 + rm -rf $(DISTDIR)/
  125 +deb: docclean distreal
  126 + (cd $(DISTDIR)/ && debuild)
  127 + rm -rf $(DISTDIR)/
  128 +install: META
  129 + $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
  130 + $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
  131 + $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
  132 + $(wildcard *.cma *.cmxa *.a) META
  133 +
  134 +.PHONY: \
  135 + all opt world all_non_mt all_mt opt_non_mt opt_mt \
  136 + examples examples.opt depend clean distclean dist \
  137 + install meta doc deb distreal distrm
24 Makefile.defs
... ... @@ -0,0 +1,24 @@
  1 +PKGNAME = http
  2 +DISTVERSION = $(shell dpkg-parsechangelog | egrep '^Version: ' | sed 's/^Version: //' | sed 's/-.*//')
  3 +
  4 +DEBUG_FLAGS =
  5 +REQUIRES = unix str pcre netstring
  6 +COMMON_FLAGS = $(DEBUG_FLAGS) -pp camlp4o -package "$(REQUIRES)"
  7 +THREADS_FLAGS = -package threads -thread
  8 +OCAMLFIND = ocamlfind
  9 +OCAMLC = $(OCAMLFIND) ocamlc $(COMMON_FLAGS)
  10 +OCAMLOPT = $(OCAMLFIND) ocamlopt $(COMMON_FLAGS)
  11 +OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMON_FLAGS)
  12 +OCAMLDOC := \
  13 + ocamldoc -stars \
  14 + $(shell $(OCAMLFIND) query -i-format unix) \
  15 + $(shell $(OCAMLFIND) query -i-format pcre) \
  16 + $(shell $(OCAMLFIND) query -i-format netstring)
  17 +DOT = dot
  18 +
  19 +DISTNAME = ocaml-http
  20 +DISTDIR = $(DISTNAME)-$(DISTVERSION)
  21 +EXTRA_DIST = \
  22 + INSTALL LICENSE README META.in Makefile Makefile.defs \
  23 + .depend
  24 +
4 README
... ... @@ -0,0 +1,4 @@
  1 +
  2 +OCaml HTTP is a simple OCaml library for creating HTTP daemons, it is largely
  3 +inspired to the Perl's HTTP:: modules family.
  4 +
184 debian/changelog
... ... @@ -0,0 +1,184 @@
  1 +ocaml-http (0.1.3-1) unstable; urgency=low
  2 +
  3 + * force bash as SHELL in Makefile, since we rely on bashisms
  4 + (closes: bug#381915)
  5 + * removed Http_daemon.{start,start'}, they have been deprecated a while ago
  6 + in favour of Http_daemon.main
  7 + * added 'auto_close' to daemon specifications. When set to true (defaults to
  8 + false), makes ocaml-http close every connection with client just after
  9 + having executed a callback, no matter if that callback succeeds or fails
  10 + with an exception
  11 +
  12 + -- Stefano Zacchiroli <zack@debian.org> Sun, 20 Aug 2006 18:07:41 +0200
  13 +
  14 +ocaml-http (0.1.2-4) unstable; urgency=low
  15 +
  16 + * Rebuilt against ocaml 3.09.2, bumped deps accordingly.
  17 + * debian/control
  18 + - Bumped Standards-Version to 3.7.2 (no changes needed)
  19 +
  20 + -- Stefano Zacchiroli <zack@debian.org> Wed, 17 May 2006 05:18:32 +0000
  21 +
  22 +ocaml-http (0.1.2-3) unstable; urgency=low
  23 +
  24 + * Rebuilt against OCaml 3.09.1, bumped deps accordingly.
  25 +
  26 + -- Stefano Zacchiroli <zack@debian.org> Sun, 8 Jan 2006 13:13:07 +0100
  27 +
  28 +ocaml-http (0.1.2-2) unstable; urgency=low
  29 +
  30 + * rebuilt with ocaml 3.09
  31 + * debian/*
  32 + - no more hardcoding of ocaml abi version anywhere
  33 + * debian/rules
  34 + - use cdbs
  35 +
  36 + -- Stefano Zacchiroli <zack@debian.org> Sat, 26 Nov 2005 20:28:26 +0100
  37 +
  38 +ocaml-http (0.1.2-1) unstable; urgency=low
  39 +
  40 + * avoid exceptions for closing connection twice during finaliztion of
  41 + connection objects (thanks to Eric Strokes <eric.stokes@csun.edu>
  42 + for the patch)
  43 +
  44 + -- Stefano Zacchiroli <zack@debian.org> Wed, 14 Sep 2005 18:03:40 +0200
  45 +
  46 +ocaml-http (0.1.1-1) unstable; urgency=low
  47 +
  48 + * added ?default parameter to "param" method
  49 + * fixed bug in response status line parsing
  50 + * integrated patch for HTTP/1.1 persistent connections from
  51 + Eric Cooper <ecc@cmu.edu>:
  52 + - added support for persistent connections to http_daemon.ml: server
  53 + now loops until End_of_file (or any exception) occurs when trying
  54 + to parse the next request
  55 + * debian/control
  56 + - bumped pcre and ocamlnet dependencies
  57 + - bumped standards-version to 3.6.2
  58 +
  59 + -- Stefano Zacchiroli <zack@debian.org> Wed, 16 Mar 2005 09:24:07 +0100
  60 +
  61 +ocaml-http (0.1.0-2) unstable; urgency=low
  62 +
  63 + * rebuilt against ocaml 3.08.3
  64 +
  65 + -- Stefano Zacchiroli <zack@debian.org> Tue, 29 Mar 2005 11:39:24 +0200
  66 +
  67 +ocaml-http (0.1.0-1) unstable; urgency=low
  68 +
  69 + * first debian official package
  70 +
  71 + -- Stefano Zacchiroli <zack@debian.org> Tue, 8 Feb 2005 22:45:54 +0100
  72 +
  73 +ocaml-http (0.1.0) unstable; urgency=low
  74 +
  75 + * added "daemon specifications": a unified way of specifying daemons
  76 + behaviour including old parameters of Http_daemon.start together
  77 + with authentication requirements and exception handling
  78 + * added new way of building daemons starting from specifications, old
  79 + ways (e.g. Http_daemon.start) are now deprecated
  80 + * added sigpipe handling to avoid daemons dying for uncaught signals
  81 + * added exception handler (as part of a daemon specification), it can
  82 + be used to ensure that some code is execute before a process/thread
  83 + die for uncaught exception (e.g. unlocking a global mutex)
  84 + * added authentication requirements (as part of a daemon
  85 + specification): an handy way to specify required user name and
  86 + password for HTTP basic authentication
  87 + * added head_callback to Http_user_agent in order to have access to
  88 + response status and headers in HTTP requests
  89 + * changed license from GPL to LGPL
  90 + * improved ocamldoc documentation and debian packaging
  91 +
  92 + -- Stefano Zacchiroli <zack@debian.org> Thu, 3 Feb 2005 23:08:14 +0100
  93 +
  94 +ocaml-http (0.0.10) unstable; urgency=low
  95 +
  96 + * renamed Http_client module to Http_user_agent to avoid compatibility
  97 + issues with Netclient. Renamed that module functions removing
  98 + "http_" prefix (e.g., summarizing, Http_client.http_get ->
  99 + Http_user_agent.get)
  100 + * ported to ocaml 3.08
  101 + * debian/control
  102 + - bumped standards version to 3.6.1.1
  103 + - changed deps to ocaml 3.08 and -nox
  104 +
  105 + -- Stefano Zacchiroli <zack@debian.org> Thu, 5 Aug 2004 15:06:49 +0200
  106 +
  107 +ocaml-http (0.0.9) unstable; urgency=low
  108 +
  109 + * Added support for HTTP Basic authentication
  110 + * Restyled Http_daemon API so that correct invocations of them are
  111 + statically typechecked
  112 + * Added support for HEAD requests to Http_client
  113 + * ~addr parameter now support not only ip addresses but also hostnames
  114 + * debian/control
  115 + - bumped Standards-Version to 3.6.1.0
  116 + * debian/rules
  117 + - moved debhelper compatibility level to debian/compat
  118 +
  119 + -- Stefano Zacchiroli <zack@debian.org> Tue, 16 Dec 2003 18:01:41 +0100
  120 +
  121 +ocaml-http (0.0.8) unstable; urgency=low
  122 +
  123 + * Added support for "ancient" HTTP requests which specify no HTTP
  124 + version
  125 + - 'version' method on message now has type 'version option'
  126 + * Http_daemon now use debugging prints from Http_common like other
  127 + modules
  128 + * Added debugging print of requests parse error
  129 + * Shutdown server socket on abnormal exit (actually: uncaught
  130 + exceptions or SIGTERM received)
  131 + * Added a lot of ocamldoc documentation
  132 + * Added minimal HTTP 1.0/1.1 client support
  133 +
  134 + -- Stefano Zacchiroli <zack@debian.org> Fri, 10 Jan 2003 10:36:53 +0100
  135 +
  136 +ocaml-http (0.0.7) unstable; urgency=low
  137 +
  138 + * Added support for POST requests
  139 + * Implemented a commont 'message' class from which 'request' and
  140 + 'response' inherit
  141 + * Changed constructor of 'request' objects, requests are now buildable
  142 + directly (and only) from an input channel
  143 + * Added client IP address information to Http_request.request class
  144 + * Added OO daemon interfaces ("daemon" and "connection" classes)
  145 + * Use Pcre to perform sanity test on headers instead of home made
  146 + parsing
  147 + * Callback functions can raise Http_types.Quit to have main daemon
  148 + quit
  149 + * Case-insensitive handling of header names
  150 +
  151 + -- Stefano Zacchiroli <zack@debian.org> Wed, 25 Dec 2002 16:22:31 +0100
  152 +
  153 +ocaml-http (0.0.6) unstable; urgency=low
  154 +
  155 + * Ship multithreaded and non multithreaded cm{x,}aS
  156 + * Added support for multiple binding of the same parameter in request
  157 + objects (new method 'paramAll')
  158 + * Added support for 'empty' bindings in query arguments (e.g.
  159 + "/foo?b=" or "/foo?b")
  160 + * Added some sanity checks
  161 + * Bumped Standards-Version to 3.5.8
  162 + * Use versioned dependencies lib{pcre,ocamlnet}-ocaml-dev-<version>
  163 + * Added 'Provides libhttp-ocaml-dev-<version>'
  164 + * Removed GPL from debian/copyright, added reference to
  165 + /usr/share/common-licenses/GPL
  166 +
  167 + -- Stefano Zacchiroli <zack@debian.org> Mon, 25 Nov 2002 11:04:49 +0100
  168 +
  169 +ocaml-http (0.0.5) unstable; urgency=low
  170 +
  171 + * Fixed bug for HTTP encoded GET parameters which contain '?' or '&'
  172 + characters
  173 + * Added support for chdir in a given document root before starting
  174 + * Added support for multi threaded daemons
  175 + * Added a generic 'Http_daemon.respond' function
  176 + * Added 'toString' method to response objects
  177 +
  178 + -- Stefano Zacchiroli <zack@debian.org> Fri, 22 Nov 2002 11:29:37 +0100
  179 +
  180 +ocaml-http (0.0.3) unstable; urgency=low
  181 +
  182 + * First release.
  183 +
  184 + -- Stefano Zacchiroli <zack@debian.org> Sun, 17 Nov 2002 17:41:41 +0100
1  debian/compat
... ... @@ -0,0 +1 @@
  1 +4
23 debian/control
... ... @@ -0,0 +1,23 @@
  1 +Source: ocaml-http
  2 +Section: devel
  3 +Priority: optional
  4 +Maintainer: Stefano Zacchiroli <zack@debian.org>
  5 +Build-Depends: debhelper (>> 4.0.0), ocaml-nox (>= 3.09.2), ocaml-findlib (>= 1.1), libpcre-ocaml-dev (>= 5.10.1-2), libocamlnet-ocaml-dev (>= 1.1-8), cdbs
  6 +Standards-Version: 3.7.2
  7 +
  8 +Package: libhttp-ocaml-dev
  9 +Architecture: any
  10 +Depends: ocaml-nox-${F:OCamlABI}, libpcre-ocaml-dev (>= 5.10.1-2), libocamlnet-ocaml-dev (>= 1.1-8)
  11 +Description: OCaml library for writing HTTP servers
  12 + OCaml HTTP is a library for the Objective Caml programming language,
  13 + used to build simple HTTP servers, largely inspired to Perl's
  14 + HTTP::Daemon module.
  15 + .
  16 + In order to implement an HTTP servers the programmer has to provide a
  17 + daemon specification which contains, among other parameters, a callback
  18 + function invoked by OCaml HTTP on well formed HTTP requests received.
  19 + HTTP responses could be sent over an out_channel connected with client
  20 + socket, accessible from the callback.
  21 + .
  22 + The library contains also facility functions that helps in creating
  23 + well formed HTTP responses and a tiny HTTP client.
23 debian/control.in
... ... @@ -0,0 +1,23 @@
  1 +Source: ocaml-http
  2 +Section: devel
  3 +Priority: optional
  4 +Maintainer: Stefano Zacchiroli <zack@debian.org>
  5 +Build-Depends: debhelper (>> 4.0.0), ocaml-nox (>= @OCamlABI@), ocaml-findlib (>= 1.1), libpcre-ocaml-dev (>= 5.10.1-2), libocamlnet-ocaml-dev (>= 1.1-8), cdbs
  6 +Standards-Version: 3.7.2
  7 +
  8 +Package: libhttp-ocaml-dev
  9 +Architecture: any
  10 +Depends: ocaml-nox-${F:OCamlABI}, libpcre-ocaml-dev (>= 5.10.1-2), libocamlnet-ocaml-dev (>= 1.1-8)
  11 +Description: OCaml library for writing HTTP servers
  12 + OCaml HTTP is a library for the Objective Caml programming language,
  13 + used to build simple HTTP servers, largely inspired to Perl's
  14 + HTTP::Daemon module.
  15 + .
  16 + In order to implement an HTTP servers the programmer has to provide a
  17 + daemon specification which contains, among other parameters, a callback
  18 + function invoked by OCaml HTTP on well formed HTTP requests received.
  19 + HTTP responses could be sent over an out_channel connected with client
  20 + socket, accessible from the callback.
  21 + .
  22 + The library contains also facility functions that helps in creating
  23 + well formed HTTP responses and a tiny HTTP client.
15 debian/copyright
... ... @@ -0,0 +1,15 @@
1  debian/dirs
... ... @@ -0,0 +1 @@
  1 +/usr/lib/ocaml/3.09.2
1  debian/dirs.in
... ... @@ -0,0 +1 @@
  1 +/usr/lib/ocaml/@OCamlABI@
12 debian/doc-base
... ... @@ -0,0 +1,12 @@
  1 +Document: ocaml-http
  2 +Title: OCaml HTTP API reference manual
  3 +Author: Stefano Zacchiroli
  4 +Abstract: API reference manual for OCaml HTTP, an Objective Caml library for writing HTTP servers
  5 +Section: Apps/Programming
  6 +
  7 +Format: HTML
  8 +Index: /usr/share/doc/libhttp-ocaml-dev/html/index.html
  9 +Files: /usr/share/doc/libhttp-ocaml-dev/html/*
  10 +
  11 +Format: PostScript
  12 +Files: /usr/share/doc/libhttp-ocaml-dev/ocaml-http.ps.gz
2  debian/docs
... ... @@ -0,0 +1,2 @@
  1 +README
  2 +doc/*
1  debian/examples
... ... @@ -0,0 +1 @@
  1 +examples/*.ml
24 debian/rules
... ... @@ -0,0 +1,24 @@
  1 +#!/usr/bin/make -f
  2 +include /usr/share/cdbs/1/rules/debhelper.mk
  3 +include /usr/share/cdbs/1/class/makefile.mk
  4 +
  5 +PKGNAME = libhttp-ocaml-dev
  6 +
  7 +OCAMLABI := $(shell ocamlc -version)
  8 +OCAMLLIBDIR := $(shell ocamlc -where)
  9 +OFILES_ALL := $(patsubst %.in,%,$(shell ls debian/*.in))
  10 +OFILES := $(filter-out debian/rules, $(OFILES_ALL))
  11 +HAVE_OCAMLOPT := $(shell test -x /usr/bin/ocamlopt && echo "yes")
  12 +DEB_DH_GENCONTROL_ARGS = -- -VF:OCamlABI="$(OCAMLABI)"
  13 +DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/$(PKGNAME)$(OCAMLLIBDIR)
  14 +
  15 +ocamlinit:
  16 + for f in $(OFILES_ALL); do sed -e 's/@OCamlABI@/$(OCAMLABI)/g' $$f.in > $$f; done
  17 +
  18 +makebuilddir/$(PKGNAME)::
  19 + for f in $(OFILES); do sed -e 's/@OCamlABI@/$(OCAMLABI)/g' $$f.in > $$f; done
  20 +
  21 +ifeq ($(HAVE_OCAMLOPT),yes)
  22 +build/$(PKGNAME)::
  23 + $(MAKE) opt
  24 +endif
2  doc/html/.cvsignore
... ... @@ -0,0 +1,2 @@
  1 +*.css
  2 +*.html
92 doc/html/Http_common.html
... ... @@ -0,0 +1,92 @@
  1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2 +<html>
  3 +<head>
  4 +<link rel="stylesheet" href="style.css" type="text/css">
  5 +<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
  6 +<link rel="Start" href="index.html">
  7 +<link rel="next" href="Http_constants.html">
  8 +<link rel="Up" href="index.html">
  9 +<link title="Index of types" rel=Appendix href="index_types.html">
  10 +<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
  11 +<link title="Index of values" rel=Appendix href="index_values.html">
  12 +<link title="Index of class methods" rel=Appendix href="index_methods.html">
  13 +<link title="Index of classes" rel=Appendix href="index_classes.html">
  14 +<link title="Index of class types" rel=Appendix href="index_class_types.html">
  15 +<link title="Index of modules" rel=Appendix href="index_modules.html">
  16 +<link title="Http_common" rel="Chapter" href="Http_common.html">
  17 +<link title="Http_constants" rel="Chapter" href="Http_constants.html">
  18 +<link title="Http_daemon" rel="Chapter" href="Http_daemon.html">
  19 +<link title="Http_message" rel="Chapter" href="Http_message.html">
  20 +<link title="Http_misc" rel="Chapter" href="Http_misc.html">
  21 +<link title="Http_parser" rel="Chapter" href="Http_parser.html">
  22 +<link title="Http_parser_sanity" rel="Chapter" href="Http_parser_sanity.html">
  23 +<link title="Http_request" rel="Chapter" href="Http_request.html">
  24 +<link title="Http_response" rel="Chapter" href="Http_response.html">
  25 +<link title="Http_tcp_server" rel="Chapter" href="Http_tcp_server.html">
  26 +<link title="Http_threaded_tcp_server" rel="Chapter" href="Http_threaded_tcp_server.html">
  27 +<link title="Http_types" rel="Chapter" href="Http_types.html">
  28 +<link title="Http_user_agent" rel="Chapter" href="Http_user_agent.html"><title>Http_common</title>
  29 +</head>
  30 +<body>
  31 +<div class="navbar">&nbsp;<a href="index.html">Up</a>
  32 +&nbsp;<a href="Http_constants.html">Next</a>
  33 +</div>
  34 +<center><h1>Module <a href="type_Http_common.html">Http_common</a></h1></center>
  35 +<br>
  36 +<pre><span class="keyword">module</span> Http_common: <code class="code">sig</code> <a href="Http_common.html">..</a> <code class="code">end</code></pre>Common functionalities shared by other OCaml HTTP modules<br>
  37 +<hr width="100%">
  38 +<pre><span class="keyword">val</span> <a name="VALdebug"></a>debug : <code class="type">bool Pervasives.ref</code></pre><div class="info">
  39 +whether debugging messages are enabled or not, can be changed at runtime<br>
  40 +</div>
  41 +<pre><span class="keyword">val</span> <a name="VALdebug_print"></a>debug_print : <code class="type">string -> unit</code></pre><div class="info">
  42 +print a string on stderr only if debugging is enabled<br>
  43 +</div>
  44 +<pre><span class="keyword">val</span> <a name="VALhttp_version"></a>http_version : <code class="type"><a href="Http_types.html#TYPEversion">Http_types.version</a></code></pre><div class="info">
  45 +see <a href="Http_constants.html#VALversion"><code class="code">Http_constants.version</code></a><br>
  46 +</div>
  47 +<pre><span class="keyword">val</span> <a name="VALserver_string"></a>server_string : <code class="type">string</code></pre><div class="info">
  48 +see <a href="Http_constants.html#VALserver_string"><code class="code">Http_constants.server_string</code></a><br>
  49 +</div>
  50 +<pre><span class="keyword">val</span> <a name="VALstring_of_version"></a>string_of_version : <code class="type"><a href="Http_types.html#TYPEversion">Http_types.version</a> -> string</code></pre><div class="info">
  51 +pretty print an HTTP version<br>
  52 +</div>
  53 +<pre><span class="keyword">val</span> <a name="VALversion_of_string"></a>version_of_string : <code class="type">string -> <a href="Http_types.html#TYPEversion">Http_types.version</a></code></pre><div class="info">
  54 +parse an HTTP version from a string<br>
  55 +<b>Raises</b> <code>Invalid_HTTP_version</code> if given string doesn't represent a supported HTTP
  56 + version<br>
  57 +</div>
  58 +<pre><span class="keyword">val</span> <a name="VALstring_of_method"></a>string_of_method : <code class="type"><a href="Http_types.html#TYPEmeth">Http_types.meth</a> -> string</code></pre><div class="info">
  59 +pretty print an HTTP method<br>
  60 +</div>
  61 +<pre><span class="keyword">val</span> <a name="VALmethod_of_string"></a>method_of_string : <code class="type">string -> <a href="Http_types.html#TYPEmeth">Http_types.meth</a></code></pre><div class="info">
  62 +parse an HTTP method from a string<br>
  63 +<b>Raises</b> <code>Invalid_HTTP_method</code> if given string doesn't represent a supported
  64 + method<br>
  65 +</div>
  66 +<pre><span class="keyword">val</span> <a name="VALstatus_of_code"></a>status_of_code : <code class="type">int -> <a href="Http_types.html#TYPEstatus">Http_types.status</a></code></pre><div class="info">
  67 +converts an integer HTTP status to the corresponding status value<br>
  68 +<b>Raises</b> <code>Invalid_code</code> if given integer isn't a valid HTTP status code<br>
  69 +</div>
  70 +<pre><span class="keyword">val</span> <a name="VALcode_of_status"></a>code_of_status : <code class="type">[< <a href="Http_types.html#TYPEstatus">Http_types.status</a> ] -> int</code></pre><div class="info">
  71 +converts an HTTP status to the corresponding integer value<br>
  72 +</div>
  73 +<pre><span class="keyword">val</span> <a name="VALis_informational"></a>is_informational : <code class="type">int -> bool</code></pre><div class="info">
  74 +<b>Returns</b> true on "informational" status codes, false elsewhere<br>
  75 +</div>
  76 +<pre><span class="keyword">val</span> <a name="VALis_success"></a>is_success : <code class="type">int -> bool</code></pre><div class="info">
  77 +<b>Returns</b> true on "success" status codes, false elsewhere<br>
  78 +</div>
  79 +<pre><span class="keyword">val</span> <a name="VALis_redirection"></a>is_redirection : <code class="type">int -> bool</code></pre><div class="info">
  80 +<b>Returns</b> true on "redirection" status codes, false elsewhere<br>
  81