Http_client.Http_protocol (Unix.Unix_error (Unix.EINPROGRESS, "connect", "")).

Pierre-Alexandre Voye <[email protected]> Fri, 23 Dec 2011 16:11:08 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <CANnJ5GeAECqtoVP4aaeoG8XfYPeXTDu+edT9rKeoQX2HiJmPug@mail.gmail.com>
Hi everyone,

I have just discovered a strange behavior of ocamlnet.

As i understood, it seems like if you load certain library together, the
library is unable to make a simple http_get.
I need to add these libs (particularly SSL), because i have to write a POST
multipart https function.

Here an example with the toplevel which show the problem :
(Sorry for the long long command)

1. It works :-)

$ ocaml -I /opt/local/lib/ocaml/site-lib/pcre -I
/opt/local/lib/ocaml/site-lib/netsys -I
/opt/local/lib/ocaml/site-lib/netstring -I
/opt/local/lib/ocaml/site-lib/netcgi2 -I
/opt/local/lib/ocaml/site-lib/equeue -I
/opt/local/lib/ocaml/site-lib/netclient
/opt/local/lib/ocaml/site-lib/pcre/pcre.cma /opt/local/lib/ocaml/unix.cma
/opt/local/lib/ocaml/bigarray.cma
/opt/local/lib/ocaml/site-lib/netsys/netsys_oothr.cma
/opt/local/lib/ocaml/site-lib/netsys/netsys.cma
/opt/local/lib/ocaml/site-lib/netstring/netstring.cma
/opt/local/lib/ocaml/site-lib/netstring/netaccel.cma
/opt/local/lib/ocaml/site-lib/netstring/netaccel_link.cmo
/opt/local/lib/ocaml/site-lib/netcgi2/netcgi.cma
/opt/local/lib/ocaml/site-lib/equeue/equeue.cma
/opt/local/lib/ocaml/site-lib/netgssapi/netgssapi.cma
/opt/local/lib/ocaml/site-lib/rpc/rpc.cma
/opt/local/lib/ocaml/site-lib/netplex/netplex.cma
/opt/local/lib/ocaml/site-lib/nethttpd/nethttpd.cma
/opt/local/lib/ocaml/site-lib/netclient/netclient.cma

        Objective Caml version 3.12.1

# Http_client.Convenience.http_get "http://perdu.com";;
- : string =
"<html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur
l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2><strong><pre>
* <----- vous &ecirc;tes ici</pre></strong></body></html>\n"


2. There's a problem !

ocaml -I /opt/local/lib/ocaml/site-lib/pcre -I
/opt/local/lib/ocaml/site-lib/netsys -I
/opt/local/lib/ocaml/site-lib/netstring -I
/opt/local/lib/ocaml/site-lib/netcgi2 -I
/opt/local/lib/ocaml/site-lib/equeue -I
/opt/local/lib/ocaml/site-lib/netgssapi -I
/opt/local/lib/ocaml/site-lib/rpc -I /opt/local/lib/ocaml/site-lib/netplex
-I /opt/local/lib/ocaml/site-lib/nethttpd -I
/opt/local/lib/ocaml/site-lib/nethttpd-for-netcgi2 -I
/opt/local/lib/ocaml/site-lib/netclient -I
/opt/local/lib/ocaml/site-lib/easy-format -I
/opt/local/lib/ocaml/site-lib/atd -I /opt/local/lib/ocaml/site-lib/biniou
-I /opt/local/lib/ocaml/site-lib/yojson -I
/opt/local/lib/ocaml/site-lib/atdgen -I /opt/local/lib/ocaml/site-lib/ssl
-I /opt/local/lib/ocaml/site-lib/equeue-ssl -I
/opt/local/lib/ocaml/site-lib/rpc-ssl
/opt/local/lib/ocaml/site-lib/pcre/pcre.cma /opt/local/lib/ocaml/unix.cma
/opt/local/lib/ocaml/bigarray.cma
/opt/local/lib/ocaml/site-lib/netsys/netsys_oothr.cma
/opt/local/lib/ocaml/site-lib/netsys/netsys.cma
/opt/local/lib/ocaml/site-lib/netstring/netstring.cma
/opt/local/lib/ocaml/site-lib/netstring/netaccel.cma
/opt/local/lib/ocaml/site-lib/netstring/netaccel_link.cmo
/opt/local/lib/ocaml/site-lib/netcgi2/netcgi.cma
/opt/local/lib/ocaml/site-lib/equeue/equeue.cma
/opt/local/lib/ocaml/site-lib/netgssapi/netgssapi.cma
/opt/local/lib/ocaml/site-lib/rpc/rpc.cma
/opt/local/lib/ocaml/site-lib/netplex/netplex.cma
/opt/local/lib/ocaml/site-lib/nethttpd/nethttpd.cma
/opt/local/lib/ocaml/site-lib/netclient/netclient.cma
/opt/local/lib/ocaml/str.cma
/opt/local/lib/ocaml/site-lib/easy-format/easy_format.cmo
/opt/local/lib/ocaml/site-lib/atd/atd.cma
/opt/local/lib/ocaml/site-lib/biniou/biniou.cma
/opt/local/lib/ocaml/site-lib/yojson/yojson.cmo
/opt/local/lib/ocaml/site-lib/atdgen/atdgen.cma
/opt/local/lib/ocaml/site-lib/ssl/ssl.cma
/opt/local/lib/ocaml/site-lib/equeue-ssl/equeue_ssl.cma
/opt/local/lib/ocaml/site-lib/rpc-ssl/rpc_ssl.cma

Objective Caml version 3.12.1

# Http_client.Convenience.http_get "http://perdu.com";;
Exception:
Http_client.Http_protocol (Unix.Unix_error (Unix.EINPROGRESS, "connect",
"")).


So every http_call doesn't work, and of course https  with post verb.

is anayone have an idea ?



Merry Christmas to all !


Pierre-Alexandre
-- 
---------------------
https://twitter.com/#!/ontologiae/
http://linuxfr.org/users/montaigne

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel