Ticket #18786: devel--caml-ocamlnet.patch

File devel--caml-ocamlnet.patch, 10.4 KB (added by Damien.Pollet@…, 16 years ago)
  • devel/caml-ocamlnet/Portfile

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/Portfile devel/caml-ocamlnet/Portfile
    old new  
    44
    55name                caml-ocamlnet
    66version             2.2.9
     7revision            3
    78categories          devel ml
    89maintainers         landonf openmaintainer
    910description         Internet protocols and helper data structures for OCaml.
     
    2930                    port:caml-findlib \
    3031                    port:caml-pcre
    3132
     33patchfiles          patch-http_client.ml.diff patch-rpc_transport.ml.diff \
     34                    patch-uq_engines.ml.diff patch-nethttpd_kernel.ml.diff \
     35                    patch-netstring_nethttp.ml.diff patch-http_client.mli.diff
     36
    3237post-patch {
    3338    set ocaml_site_path [exec ocamlfind printconf destdir]
    3439    reinplace       "s|\$(OCAMLFIND) install|\$(OCAMLFIND) install -destdir ${destroot}/${ocaml_site_path}|g" \
     
    3641}
    3742
    3843configure {
    39     system "cd ${worksrcpath} && ./configure"
     44    system "cd ${worksrcpath} && ./configure -with-nethttpd"
    4045}
    4146
    4247build.target        all opt
  • devel/caml-ocamlnet/files/patch-http_client.ml.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-http_client.ml.diff devel/caml-ocamlnet/files/patch-http_client.ml.diff
    old new  
     1--- src/netclient/http_client.ml.orig   2009-03-18 16:59:19.000000000 +0000
     2+++ src/netclient/http_client.ml        2009-03-19 00:41:06.000000000 +0000
     3@@ -1567,7 +1567,7 @@
     4              if not (List.mem fd fd_list) then
     5                Hashtbl.replace rev_inactive_conns peer (fd :: fd_list)
     6            with
     7-             | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
     8+             | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) ->
     9                  self # forget_connection fd
     10          )
     11 
     12@@ -4461,6 +4461,15 @@
     13 
     14     let http_post url params = (http_post_message url params) # get_resp_body()
     15 
     16+    let http_post_raw_message ?(callfn=(fun _ -> ())) url raw_param =
     17+      let m = new post_raw (prepare_url url) raw_param in
     18+      callfn m;
     19+      request m 1;
     20+      m
     21+
     22+    let http_post_raw ?(callfn=(fun _ -> ())) url raw_param =
     23+      (http_post_raw_message ~callfn url raw_param) # get_resp_body()
     24+   
     25     let http_put_message url content =
     26       let m = new put (prepare_url url) content in
     27       request m !http_trials;
  • devel/caml-ocamlnet/files/patch-http_client.mli.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-http_client.mli.diff devel/caml-ocamlnet/files/patch-http_client.mli.diff
    old new  
     1--- src/netclient/http_client.mli.orig  2009-03-18 15:26:57.000000000 +0000
     2+++ src/netclient/http_client.mli       2009-03-19 00:40:15.000000000 +0000
     3@@ -1094,6 +1094,13 @@
     4       * The list contains the parameters sent with the POST request.
     5       *)
     6 
     7+  val http_post_raw_message: ?callfn:(post_raw -> unit) -> string -> string -> http_call
     8+    (** Does a "POST" request with the given raw body and returns the reply.
     9+      * The string contains the raw message body sent with the POST request.
     10+      * If specified, callfn is applied to the underlying post_raw object before
     11+      * the request is sent (e.g. to add a custom HTTP header).
     12+      *)
     13+
     14   val http_put_message : string -> string -> http_call
     15     (** Does a "PUT" request with the given URL and returns the reply.
     16       * The second argument contains the contents to be put.
     17@@ -1112,6 +1119,12 @@
     18       * The list contains the parameters send with the POST request.
     19      *)
     20 
     21+  val http_post_raw : ?callfn:(post_raw -> unit) -> string -> string -> string
     22+    (** Does a "POST" request with the given raw body and returns the reply.
     23+      * The string contains the raw message body sent with the POST request.
     24+      * If specified, callfn is applied to the underlying post_raw object before
     25+      * the request is sent (e.g. to add a custom HTTP header) *)
     26+
     27   val http_put : string -> string -> string
     28     (** Does a "PUT" request with the given URL and returns the response body.
     29       * The second argument contains the contents to be put.
     30@@ -1124,7 +1137,6 @@
     31 
     32   val http_verbose : unit -> unit
     33     (** Turns on debug messages on stderr. *)
     34-
     35 end
     36 
     37 (**/**)
  • devel/caml-ocamlnet/files/patch-nethttpd_kernel.ml.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-nethttpd_kernel.ml.diff devel/caml-ocamlnet/files/patch-nethttpd_kernel.ml.diff
    old new  
     1--- src/nethttpd-for-netcgi1/nethttpd_kernel.ml.orig    2007-11-01 22:12:31.000000000 +0000
     2+++ src/nethttpd-for-netcgi1/nethttpd_kernel.ml 2009-02-04 21:39:19.000000000 +0000
     3@@ -249,9 +249,9 @@
     4                  transfer_encoding <- `Identity;
     5          );
     6          (* Update the header: *)
     7-         ( match transfer_encoding with
     8-             | `Identity -> resp_header # delete_field "Transfer-Encoding"
     9-             | `Chunked  -> set_transfer_encoding resp_header ["chunked", []]
     10+         ( match transfer_encoding, suppress_body with
     11+             | `Identity,false | _,true -> resp_header # delete_field "Transfer-Encoding"
     12+             | `Chunked,false -> set_transfer_encoding resp_header ["chunked", []]
     13          );
     14          resp_header # delete_field "Trailer";
     15          set_date resp_header (Unix.time());
  • devel/caml-ocamlnet/files/patch-netstring_nethttp.ml.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-netstring_nethttp.ml.diff devel/caml-ocamlnet/files/patch-netstring_nethttp.ml.diff
    old new  
     1--- src/netstring/nethttp.ml.orig       2009-03-03 02:59:38.000000000 +0000
     2+++ src/netstring/nethttp.ml    2009-03-03 03:00:25.000000000 +0000
     3@@ -353,15 +353,16 @@
     4   let l' = List.map (Netencoding.Url.encode ~plus:false) l in
     5   Neturl.join_path l'
     6 
     7-let uripath_decode s =
     8+let rec uripath_decode s =
     9   let l = Neturl.split_path s in
     10   let l' =
     11     List.map
     12       (fun u ->
     13         let u' = Netencoding.Url.decode ~plus:false u in
     14         if String.contains u' '/' then
     15-          failwith "Nethttp.uripath_decode";
     16-        u')
     17+             uripath_decode u'
     18+         else
     19+             u')
     20       l in
     21   Neturl.join_path l'
     22 
  • devel/caml-ocamlnet/files/patch-rpc_transport.ml.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-rpc_transport.ml.diff devel/caml-ocamlnet/files/patch-rpc_transport.ml.diff
    old new  
     1--- src/rpc/rpc_transport.ml.orig       2009-02-03 16:13:34.000000000 +0000
     2+++ src/rpc/rpc_transport.ml    2009-02-03 16:16:50.000000000 +0000
     3@@ -236,7 +236,7 @@
     4     with
     5       | Unix.Unix_error((Unix.EAFNOSUPPORT|Unix.EOPNOTSUPP),_,_) ->
     6          Some `Implied
     7-      | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
     8+      | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) ->
     9          (* ENOTCONN is special because we allow to set the peer address
     10              per datagram in this case!
     11            *)
     12@@ -552,9 +552,10 @@
     13       `Sockaddr(Unix.getpeername fd)
     14     with
     15        (* also catching ENOTCONN - which might happen for strange socket
     16-           implementations
     17+           implementations. EINVAL is thrown on MacOS 10.5 instead of ENOTCONN
     18          *)
     19-      | Unix.Unix_error((Unix.EAFNOSUPPORT|Unix.EOPNOTSUPP|Unix.ENOTSOCK|Unix.ENOTCONN),
     20+      | Unix.Unix_error((Unix.EAFNOSUPPORT|Unix.EOPNOTSUPP|Unix.ENOTSOCK|
     21+                         Unix.ENOTCONN|Unix.EINVAL),
     22                        _,_) -> `Implied in
     23   let mplex =
     24     Uq_engines.create_multiplex_controller_for_connected_socket
  • devel/caml-ocamlnet/files/patch-uq_engines.ml.diff

    diff -ruN /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/caml-ocamlnet/files/patch-uq_engines.ml.diff devel/caml-ocamlnet/files/patch-uq_engines.ml.diff
    old new  
     1--- src/equeue/uq_engines.ml.orig       2009-02-03 16:17:18.000000000 +0000
     2+++ src/equeue/uq_engines.ml    2009-02-03 16:18:51.000000000 +0000
     3@@ -1456,7 +1456,7 @@
     4       (* fd is a connected socket *)
     5       `Recv_send addr
     6     with
     7-      | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
     8+      | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) ->
     9          (* fd is an unconnected socket *)
     10          `Recvfrom_sendto
     11       | Unix.Unix_error(Unix.ENOTSOCK,_,_) ->
     12@@ -2329,7 +2329,7 @@
     13                  ignore(Unix.getpeername s);
     14                  `Done(`Socket(s, getsockspec stype s))
     15                with
     16-                 | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
     17+                 | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) ->
     18                      (* We did not succeed connecting. ENOTCONN is just a
     19                        * substitute error code, not the real error, however.
     20                        *)
     21@@ -2349,7 +2349,7 @@
     22                               ignore(Unix.getpeername s);
     23                               `Done(`Socket(s, getsockspec stype s))
     24                             with
     25-                              | Unix.Unix_error(Unix.ENOTCONN,_,_) ->
     26+                              | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) ->
     27                                   (* See comment above *)
     28                                   `Error (getconnerror s)
     29                               | error ->
     30@@ -2503,7 +2503,7 @@
     31                       let ps =
     32                         try getpeerspec Unix.SOCK_STREAM sock'
     33                         with
     34-                          | Unix.Unix_error(Unix.ENOTCONN,_,_) as e ->
     35+                          | Unix.Unix_error((Unix.ENOTCONN|Unix.EINVAL),_,_) as e ->
     36                               Unix.close sock';
     37                               raise e in
     38                       acc_engine <- None;