You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
(34) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(6) |
Feb
(1) |
Mar
(12) |
Apr
|
May
(3) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2003 |
Jan
|
Feb
(6) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
(9) |
May
(17) |
Jun
(14) |
Jul
(13) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(5) |
2006 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(1) |
Oct
(16) |
Nov
(5) |
Dec
|
2007 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2008 |
Jan
(14) |
Feb
(5) |
Mar
(7) |
Apr
(3) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
(6) |
Mar
(9) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(17) |
Sep
(2) |
Oct
(1) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
(21) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(5) |
Jul
(23) |
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2012 |
Jan
(7) |
Feb
(9) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(9) |
Oct
|
Nov
(3) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
|
Mar
(4) |
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
(4) |
Aug
(6) |
Sep
(15) |
Oct
(7) |
Nov
(3) |
Dec
(2) |
2014 |
Jan
(1) |
Feb
|
Mar
(7) |
Apr
(2) |
May
(8) |
Jun
|
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2015 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(6) |
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(7) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gerd S. <in...@ge...> - 2012-02-29 14:41:26
|
Am Sonntag, den 26.02.2012, 23:45 +0100 schrieb Pierre-Alexandre Voye: > Hi list, > > In my mac (Lion, 10.7) I'm unable to make nqueens example work with > -mp or even -sht flags > Here my attempts : > > $ time ./nqueens -n 3 -mp > /dev/null > Fatal error: exception Unix.Unix_error(17, "", > "/Users/ontologiae/Documents/Projets/COWEBO/CoweboDev/Etudes/ocamlnet-3.5/examples/multicore/run_nqueens/netplex.controller/admin") Unix error 17 = ENAMETOOLONG. You can find this out by running in the toploop: # (Obj.magic 17 : Unix.error);; - : Unix.error = Unix.ENAMETOOLONG This refers to the path name of the Unix domain socket. Because of historical reasons, such paths are limited to 108 bytes. You can work around by e.g. creating a symlink to your working directory in /tmp. > time ./nqueens -n 3 -sht > /dev/null > Fatal error: exception Unix.Unix_error(12, "fchmod", "") > > > $ time ./nqueens -n 3 -mp2 > /dev/null > Fatal error: exception Unix.Unix_error(12, "fchmod", "") > > Is it a mac/BSD linked problem ? The fchmod problem probably is. fchmod is here called on a file descriptor referring to shared memory. This is strange because fchmod is part of the POSIX API for shared memory. Anyway, I'll just catch EINVAL and ignore it. Gerd > > Regards > > Pierre-Alexandre > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ Ocamlnet-devel mailing list Oca...@li... https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |
From: Gerd S. <in...@ge...> - 2012-02-29 13:59:50
|
I get this on a Debian-6 system: $ ocamlfind ocamlopt -package netstring -linkpkg test.ml -verbose Effective set of compiler predicates: pkg_pcre,pkg_unix,pkg_bigarray,pkg_netsys,pkg_netstring,autolink,native + ocamlopt.opt -verbose -I /opt/godi-3.12/lib/ocaml/pkg-lib/pcre -I /opt/godi-3.12/lib/ocaml/pkg-lib/netsys -I /opt/godi-3.12/lib/ocaml/pkg-lib/netstring /opt/godi-3.12/lib/ocaml/pkg-lib/pcre/pcre.cmxa /opt/godi-3.12/lib/ocaml/std-lib/unix.cmxa /opt/godi-3.12/lib/ocaml/std-lib/bigarray.cmxa /opt/godi-3.12/lib/ocaml/pkg-lib/netsys/netsys_oothr.cmxa /opt/godi-3.12/lib/ocaml/pkg-lib/netsys/netsys.cmxa /opt/godi-3.12/lib/ocaml/pkg-lib/netstring/netstring.cmxa test.ml + as -o 'test.o' '/tmp/camlasm721280.s' + as -o '/tmp/camlstartup8c9e55.o' '/tmp/camlstartupd01fb7.s' + gcc -o 'a.out' '-L/opt/godi-3.12/lib/ocaml/pkg-lib/pcre' '-L/opt/godi-3.12/lib/ocaml/pkg-lib/netsys' '-L/opt/godi-3.12/lib/ocaml/pkg-lib/netstring' '-L/opt/godi-3.12/lib/ocaml/std-lib' -L/opt/godi-3.12/lib -Wl,-rpath,/opt/godi-3.12/lib -Wl,-R/opt/godi-3.12/lib -L/opt/godi-3.12/lib -L/usr/lib '/tmp/camlstartup8c9e55.o' '/opt/godi-3.12/lib/ocaml/std-lib/std_exit.o' 'test.o' '/opt/godi-3.12/lib/ocaml/pkg-lib/netstring/netstring.a' '/opt/godi-3.12/lib/ocaml/pkg-lib/netsys/netsys.a' '/opt/godi-3.12/lib/ocaml/pkg-lib/netsys/netsys_oothr.a' '/opt/godi-3.12/lib/ocaml/std-lib/bigarray.a' '/opt/godi-3.12/lib/ocaml/std-lib/unix.a' '/opt/godi-3.12/lib/ocaml/pkg-lib/pcre/pcre.a' '/opt/godi-3.12/lib/ocaml/std-lib/stdlib.a' '-lnetsys' '-lrt' '-lbigarray' '-lunix' '-lpcre_stubs' '-L/usr/lib' '-lpcre' '/opt/godi-3.12/lib/ocaml/std-lib/libasmrun.a' -lm -ldl Apparently, there is no -lpthread, but this error is implicitly cured: $ ldd a.out linux-vdso.so.1 => (0x00007fff4b5c0000) librt.so.1 => /lib/librt.so.1 (0x00007fa366eb5000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa366c85000) libm.so.6 => /lib/libm.so.6 (0x00007fa366a02000) libdl.so.2 => /lib/libdl.so.2 (0x00007fa3667fe000) libc.so.6 => /lib/libc.so.6 (0x00007fa36649c000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa36627f000) /lib64/ld-linux-x86-64.so.2 (0x00007fa3670d7000) $ ldd /lib/librt.so.1 linux-vdso.so.1 => (0x00007ffffbd35000) libc.so.6 => /lib/libc.so.6 (0x00007f0d1910d000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0d18ef1000) /lib64/ld-linux-x86-64.so.2 (0x00007f0d19691000) So, I think -lpthread should be added anyway. What I do not understand in your output is that the semaphore functions (which have nothing to do with threads) used to be in librt, not in libpthread, and they are also not found. Was there some change on the OS side in the meantime? Gerd Am Mittwoch, den 29.02.2012, 09:57 +0100 schrieb Stéphane Glondu: > Le 23/02/2012 00:04, Gerd Stolpmann a écrit : > > it is time for another version of Ocamlnet. The new release 3.5 focuses on > > the system interface, and includes a long list of smaller improvements. > > [...] > > It seems that this new release adds a new dependency to threads in some > situations: > > $ cat test.ml > let () = ignore (Netconversion.ustring_of_uchar `Enc_utf8 0) > $ ocamlfind ocamlopt -package netstring -linkpkg test.ml > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `free_sem_block': > (.text+0x58): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_open': > (.text+0xba): undefined reference to `sem_open' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_close': > (.text+0x10c): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_unlink': > (.text+0x13a): undefined reference to `sem_unlink' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_init': > (.text+0x178): undefined reference to `sem_init' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_destroy': > (.text+0x1d8): undefined reference to `sem_destroy' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_getvalue': > (.text+0x220): undefined reference to `sem_getvalue' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_post': > (.text+0x272): undefined reference to `sem_post' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2cc): undefined reference to `sem_wait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2d8): undefined reference to `sem_trywait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0x81): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xa7b): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xb6d): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_lock': > (.text+0x34): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_unlock': > (.text+0x11a): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `netsys_watch_subprocess': > (.text+0x65e): undefined reference to `pthread_create' > collect2: ld returned 1 exit status > File "caml_startup", line 1, characters 0-1: > Error: Error during linking > $ ocamlfind ocamlopt -thread -package netstring -linkpkg test.ml > $ echo $? > 0 > > Whith ocamlnet 3.4.1, the -thread switch was not needed. Is that > expected? Even if it is, I would expect a more explanatory error message... > > > Cheers, > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |
From: Stéphane G. <st...@gl...> - 2012-02-29 13:49:24
|
Le 29/02/2012 14:41, Gerd Stolpmann a écrit : > I get this on a Debian-6 system: I forgot to mention that the errors were gathered on Debian unstable (today's). > [...] > So, I think -lpthread should be added anyway. What I do not understand > in your output is that the semaphore functions (which have nothing to do > with threads) used to be in librt, not in libpthread, and they are also > not found. Was there some change on the OS side in the meantime? Maybe this is related to: http://wiki.debian.org/ToolChain/DSOLinking Cheers, -- Stéphane |
From: Gerd S. <in...@ge...> - 2012-02-29 13:34:10
|
Am Mittwoch, den 29.02.2012, 09:57 +0100 schrieb Stéphane Glondu: > Le 23/02/2012 00:04, Gerd Stolpmann a écrit : > > it is time for another version of Ocamlnet. The new release 3.5 focuses on > > the system interface, and includes a long list of smaller improvements. > > [...] > > It seems that this new release adds a new dependency to threads in some > situations: > > $ cat test.ml > let () = ignore (Netconversion.ustring_of_uchar `Enc_utf8 0) > $ ocamlfind ocamlopt -package netstring -linkpkg test.ml > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `free_sem_block': > (.text+0x58): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_open': > (.text+0xba): undefined reference to `sem_open' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_close': > (.text+0x10c): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_unlink': > (.text+0x13a): undefined reference to `sem_unlink' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_init': > (.text+0x178): undefined reference to `sem_init' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_destroy': > (.text+0x1d8): undefined reference to `sem_destroy' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_getvalue': > (.text+0x220): undefined reference to `sem_getvalue' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_post': > (.text+0x272): undefined reference to `sem_post' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2cc): undefined reference to `sem_wait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2d8): undefined reference to `sem_trywait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0x81): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xa7b): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xb6d): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_lock': > (.text+0x34): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_unlock': > (.text+0x11a): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `netsys_watch_subprocess': > (.text+0x65e): undefined reference to `pthread_create' > collect2: ld returned 1 exit status > File "caml_startup", line 1, characters 0-1: > Error: Error during linking > $ ocamlfind ocamlopt -thread -package netstring -linkpkg test.ml > $ echo $? > 0 > > Whith ocamlnet 3.4.1, the -thread switch was not needed. Is that > expected? Even if it is, I would expect a more explanatory error message... Hmmm, this is strange. Looks like -lrt and -lpthread are missing in the link. The -thread switch shouldn't be necessary. The strange thing is that this aspect did not change between 3.4.1 and 3.5. Already 3.4.1 used pthread directly (no matter whether -thread was given or not given), in order to handle the case correctly where some C library routine starts hidden pthreads. I'll investigate. Gerd > > Cheers, > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |
From: Stéphane G. <st...@gl...> - 2012-02-29 09:22:41
|
Le 23/02/2012 00:04, Gerd Stolpmann a écrit : > it is time for another version of Ocamlnet. The new release 3.5 focuses on > the system interface, and includes a long list of smaller improvements. > [...] It seems that this new release adds a new dependency to threads in some situations: $ cat test.ml let () = ignore (Netconversion.ustring_of_uchar `Enc_utf8 0) $ ocamlfind ocamlopt -package netstring -linkpkg test.ml /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `free_sem_block': (.text+0x58): undefined reference to `sem_close' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_open': (.text+0xba): undefined reference to `sem_open' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_close': (.text+0x10c): undefined reference to `sem_close' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_unlink': (.text+0x13a): undefined reference to `sem_unlink' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_init': (.text+0x178): undefined reference to `sem_init' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_destroy': (.text+0x1d8): undefined reference to `sem_destroy' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_getvalue': (.text+0x220): undefined reference to `sem_getvalue' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_post': (.text+0x272): undefined reference to `sem_post' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_wait': (.text+0x2cc): undefined reference to `sem_wait' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function `netsys_sem_wait': (.text+0x2d8): undefined reference to `sem_trywait' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function `netsys_spawn_nat': (.text+0x81): undefined reference to `pthread_sigmask' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function `netsys_spawn_nat': (.text+0xa7b): undefined reference to `pthread_sigmask' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function `netsys_spawn_nat': (.text+0xb6d): undefined reference to `pthread_sigmask' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function `sigchld_lock': (.text+0x34): undefined reference to `pthread_sigmask' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function `sigchld_unlock': (.text+0x11a): undefined reference to `pthread_sigmask' /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function `netsys_watch_subprocess': (.text+0x65e): undefined reference to `pthread_create' collect2: ld returned 1 exit status File "caml_startup", line 1, characters 0-1: Error: Error during linking $ ocamlfind ocamlopt -thread -package netstring -linkpkg test.ml $ echo $? 0 Whith ocamlnet 3.4.1, the -thread switch was not needed. Is that expected? Even if it is, I would expect a more explanatory error message... Cheers, -- Stéphane |
From: Pierre-Alexandre V. <ont...@gm...> - 2012-02-26 22:45:59
|
Hi list, In my mac (Lion, 10.7) I'm unable to make nqueens example work with -mp or even -sht flags Here my attempts : $ time ./nqueens -n 3 -mp > /dev/null Fatal error: exception Unix.Unix_error(17, "", "/Users/ontologiae/Documents/Projets/COWEBO/CoweboDev/Etudes/ocamlnet-3.5/examples/multicore/run_nqueens/netplex.controller/admin") time ./nqueens -n 3 -sht > /dev/null Fatal error: exception Unix.Unix_error(12, "fchmod", "") $ time ./nqueens -n 3 -mp2 > /dev/null Fatal error: exception Unix.Unix_error(12, "fchmod", "") Is it a mac/BSD linked problem ? Regards Pierre-Alexandre -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Gerd S. <in...@ge...> - 2012-02-22 23:04:19
|
Hi, it is time for another version of Ocamlnet. The new release 3.5 focuses on the system interface, and includes a long list of smaller improvements. The system interface, Netsys_posix, is extended by: - Support for POSIX clocks and POSIX timers (with nanosecond resolution) - Netsys_posix.spawn usses now the posix_spawn call if present on the OS - Adding support for pollable events (as e.g. provided by Linux via eventfd). For other OS an emulation is available. - Support for epoll on Linux Note that Netsys_posix covers now large parts of POSIX realtime. Other improvements: - The code generator for XDR has been improved. A new switch -direct for ocamlrpcgen can be used to generate direct mappings between OCaml values and binary representation (in many cases). Speedups up to 50% are possible for large XDR values. - The new module Uq_mt allows it to access an event-driven resource from several kernel threads (e.g. use an RPC client commonly from several threads). - The thread-safety of Netplex container functions has been improved. - Netmulticore condition variables can now be polled, for better integration into event-based programs. - Option greedy_accepts for Netplex to support servers that accept many connections per second. With this improvement, Netplex can now accept more than 5000 connections/s, and assign them to worker processes. Last but not least there is now a new tutorial for Equeue (event systems and engines). In particular, the section about combining Ocamlnet with Lwt might be interesting. For the full list of changes (especially bug fixes), see: https://godirepo.camlcity.org/svn/lib-ocamlnet2/trunk/code/ChangeLog The download, manual, and other resources: http://projects.camlcity.org/projects/ocamlnet.html GODI has been updated. Gerd -- Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. |
From: Pierre-Alexandre V. <ont...@gm...> - 2012-01-27 09:54:32
|
All my bad, i misread documentation. Could i recommend to change regexp_string to regexp_exact_string to avoid confusing ? 2012/1/27 Pierre-Alexandre Voye <ont...@gm...> > Hello, I have a problem with a PCRE regexp using Netstring_pcre module : > My regexp ( "\s.*" ) works with perl : > perl -e ' $s = "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 > /tmp/UserLs_j.ml"; $s=~s/\s.*//g; print $s;' > *i get : 5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0* > > But if i try : > Netstring_pcre.global_replace (Netstring_pcre.regexp_string "\\s.*") "" > "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml";; > - : string = "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml" > > > Other problem : > Netstring_pcre.global_replace (Netstring_pcre.regexp_string > "^([a-f0-9]+)\\s.*") "\\1" "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 > /tmp/UserLs_j.ml";; > > Exception: > > Failure "Pcre.replace: backreference denotes nonexistent subpattern". > > > Regards, > > Pierre-Alexandre > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Pierre-Alexandre V. <ont...@gm...> - 2012-01-27 09:47:43
|
Hello, I have a problem with a PCRE regexp using Netstring_pcre module : My regexp ( "\s.*" ) works with perl : perl -e ' $s = "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml"; $s=~s/\s.*//g; print $s;' *i get : 5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0* But if i try : Netstring_pcre.global_replace (Netstring_pcre.regexp_string "\\s.*") "" "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml";; - : string = "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml" Other problem : Netstring_pcre.global_replace (Netstring_pcre.regexp_string "^([a-f0-9]+)\\s.*") "\\1" "5bcb43b5f2d12bfc39cdd4dc1a4c3757b3129bc0 /tmp/UserLs_j.ml";; Exception: Failure "Pcre.replace: backreference denotes nonexistent subpattern". Regards, Pierre-Alexandre -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Paolo D. <p.d...@gm...> - 2012-01-23 19:41:28
|
On Mon, Jan 23, 2012 at 11:41, Gerd Stolpmann <in...@ge...> wrote: > Already fixed in SVN. Thanks for finding this. Thanks. -- Paolo |
From: Gerd S. <in...@ge...> - 2012-01-23 10:41:44
|
Am Sonntag, den 22.01.2012, 17:34 +0100 schrieb Paolo Donadeo: > I just found what seems a bug in Http_client: > > > in src/netclient/http_client.ml: > > 5216 let auth_digest = > 5217 new basic_auth_handler > 5218 ~enable_auth_in_advance:true (new simple_key_handler) > > I think basic_auth_handler should be digest_auth_handler. Exactly. > If you confirm, I'll open a bug in the tracker. Is it on Sourceforge, > right? Already fixed in SVN. Thanks for finding this. Gerd > > > Regards, > > > -- > Paolo > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ Ocamlnet-devel mailing list Oca...@li... https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel |
From: Paolo D. <p.d...@gm...> - 2012-01-22 16:35:41
|
I just found what seems a bug in Http_client: in src/netclient/http_client.ml: *5216 let auth_digest = 5217 new basic_auth_handler 5218 ~enable_auth_in_advance:true (new simple_key_handler) * I think basic_auth_handler should be digest_auth_handler. If you confirm, I'll open a bug in the tracker. Is it on Sourceforge, right? Regards, -- *Paolo* |
From: Gerd S. <in...@ge...> - 2012-01-03 11:46:50
|
I guess the double linking happened before the final linking step (and probably with the best intentions). What you can do with bytecode (but not with native code) is: ocamlc -a -o newlib.cma unix.cma lib.cma So, newlib.cma includes now unix.cma, and if unix.cma is added again by the final linking step, you get it twice. Here is how to create the problem step by step: --- z.ml --- let m ex = match ex with | Unix.Unix_error(_,_,_) -> print_endline "match" | _ -> print_endline "nomatch" --- y.ml --- let () = Z.m(Unix.Unix_error(Unix.ENOENT,"","")) Now link as follows: $ ocamlc -o z unix.cma z.ml unix.cma y.ml And: $ ./z nomatch ocamlopt is immune: ocamlopt -o z unix.cmxa z.ml unix.cmxa y.ml File "y.ml", line 1, characters 0-1: Error: Files /opt/godi-3.12/lib/ocaml/std-lib/unix.cmxa and /opt/godi-3.12/lib/ocaml/std-lib/unix.cmxa both define a module named Unix I've opened a bug report (http://caml.inria.fr/mantis/view.php?id=5461). Gerd Am Dienstag, den 03.01.2012, 11:39 +0100 schrieb Pierre-Alexandre Voye: > Good shot, thank you ! > with ocamlobjinfo, i have : > 2a19929a535447ed0c8fc58ae3adc1a0 Unix > 2a19929a535447ed0c8fc58ae3adc1a0 Unix > > When i make the webserver with ocamlfind, ocamlc launchs : > > + /Developer/usr/bin/clang -o 'cwbtop' > '-L/opt/local/lib/ocaml/site-lib/pcre' > '-L/opt/local/lib/ocaml/site-lib/netsys' > '-L/opt/local/lib/ocaml/site-lib/netstring' > '-L/opt/local/lib/ocaml/site-lib/netcgi2' > '-L/opt/local/lib/ocaml/site-lib/equeue' > '-L/opt/local/lib/ocaml/site-lib/netgssapi' > '-L/opt/local/lib/ocaml/site-lib/rpc' > '-L/opt/local/lib/ocaml/site-lib/netplex' > '-L/opt/local/lib/ocaml/site-lib/nethttpd' > '-L/opt/local/lib/ocaml/site-lib/nethttpd-for-netcgi2' > '-L/opt/local/lib/ocaml/site-lib/netclient' > '-L/opt/local/lib/ocaml/site-lib/easy-format' > '-L/opt/local/lib/ocaml/site-lib/atd' > '-L/opt/local/lib/ocaml/site-lib/biniou' > '-L/opt/local/lib/ocaml/site-lib/yojson' > '-L/opt/local/lib/ocaml/site-lib/atdgen' > '-L/opt/local/lib/ocaml/site-lib/ssl' > '-L/opt/local/lib/ocaml/site-lib/equeue-ssl' > '-L/opt/local/lib/ocaml/site-lib/rpc-ssl' '-L/opt/local/lib/ocaml' > -L/opt/local/lib > '/var/folders/nh/pbvym9z90wj_9kt95s16p_3h0000gn/T/camlprim21027d.c' > '-lequeue_ssl' > '-lunix' > '-lssl_stubs' '-lcrypto' '-lssl' '-lcamlstr' '-lnetaccel_c' '-lnetsys' > '-lpthread' '-lbigarray' > '-lunix' > '-L/opt/local/lib' '-lpcre' '-lpcre_stubs' '-lcamlrun' > -I'/opt/local/lib/ocaml' -lcurses -lpthread > > In fact, it works well with ocamlopt as you said. It's realy a problem > of double link > > I searched a bit around this problem, but i don't find a way to fix > it : the clang command line always call unix two times... > (But i can test with a native version it's a beginning) > > 2011/12/29 Gerd Stolpmann <in...@ge...> > Hi, > > I cannot reproduce the problem (using my quite recent GODI > installation). That EINPROGRESS "breaks out" is quite strange, > because > the HTTP connection is made via Uq_engines.direct_connector, > and there > it is caught. > > A subtle problem I could imagine is that one of the libraries > includes > unix.cma erroneously (i.e. the Unix module is defined twice), > and > because of this there are two versions of Unix_error, and one > cannot > catch this exception anymore. You could check this by running > ocamlobjinfo on the cma files, and looking whether a "Unit > name" of Unix > occurs (should only be in unix.cma). (Btw: Do you see the > problem also > for ocamlopt-compiled programs? cmxa's cannot be partially > linked, > unlike cma's, so a linking problem is not possible.) > > My versions are: > > godi-atd-1.0.1godi1 Syntax for cross-language data > types > godi-atdgen-1.2.2 Code generator for biniou and > JSON serialization > godi-biniou-1.0.0godi1 Flexible binary data format > godi-easy-format-1.0.0godi1 Indentation made easy(ier) > godi-ocaml-3.12.1godi2 The core of the OCaml system > (compiler, runtime) > godi-ocaml-src-3.12.1godi1 OCaml sources (required for > GODI builds) > godi-ocaml-ssl-0.4.4godi2 The Secure Socket Layer > godi-ocamlnet-3.4.1 base library for network > protocols > godi-ocamlnet-crypto-3.4.1 crypto extension for ocamlnet > godi-ocamlnet-ssl-3.4.1 SSL extension for ocamlnet > godi-pcre-6.2.3 Perl compatible regular > expressions > godi-yojson-1.0.2godi1 JSON library succeeding to > json-wheel > > We can enable debugging. I get then: > > # Http_client.Debug.enable := true;; > - : unit = () > # Http_client.Convenience.http_get "http://perdu.com";; > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP > connection: creating direct connection to perdu.com:80 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - HTTP direct connection to perdu.com:80: Connected! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP > Connection: adding call 74 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call > 74: initialize transmitter > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - Call 74 - HTTP request: GET / HTTP/1.1 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - HTTP connection: Got Call 74! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - HTTP connection: pipelining=true persistency=false > close_connection=false->false > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call > 74 - postprocessing > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - HTTP connection: Shutdown! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 > - HTTP connection: Closing socket! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP > connection: checking remaining pipeline requests > - : 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 êtes > ici</pre></strong></body></html>\n" > > > Gerd > > Am Freitag, den 23.12.2011, 16:11 +0100 schrieb > Pierre-Alexandre Voye: > > 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 ê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 > Oca...@li... > https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel > > > > > > -- > --------------------- > 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 Oca...@li... https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel |
From: Pierre-Alexandre V. <ont...@gm...> - 2012-01-03 10:39:56
|
Good shot, thank you ! with ocamlobjinfo, i have : 2a19929a535447ed0c8fc58ae3adc1a0 Unix 2a19929a535447ed0c8fc58ae3adc1a0 Unix When i make the webserver with ocamlfind, ocamlc launchs : + /Developer/usr/bin/clang -o 'cwbtop' '-L/opt/local/lib/ocaml/site-lib/pcre' '-L/opt/local/lib/ocaml/site-lib/netsys' '-L/opt/local/lib/ocaml/site-lib/netstring' '-L/opt/local/lib/ocaml/site-lib/netcgi2' '-L/opt/local/lib/ocaml/site-lib/equeue' '-L/opt/local/lib/ocaml/site-lib/netgssapi' '-L/opt/local/lib/ocaml/site-lib/rpc' '-L/opt/local/lib/ocaml/site-lib/netplex' '-L/opt/local/lib/ocaml/site-lib/nethttpd' '-L/opt/local/lib/ocaml/site-lib/nethttpd-for-netcgi2' '-L/opt/local/lib/ocaml/site-lib/netclient' '-L/opt/local/lib/ocaml/site-lib/easy-format' '-L/opt/local/lib/ocaml/site-lib/atd' '-L/opt/local/lib/ocaml/site-lib/biniou' '-L/opt/local/lib/ocaml/site-lib/yojson' '-L/opt/local/lib/ocaml/site-lib/atdgen' '-L/opt/local/lib/ocaml/site-lib/ssl' '-L/opt/local/lib/ocaml/site-lib/equeue-ssl' '-L/opt/local/lib/ocaml/site-lib/rpc-ssl' '-L/opt/local/lib/ocaml' -L/opt/local/lib '/var/folders/nh/pbvym9z90wj_9kt95s16p_3h0000gn/T/camlprim21027d.c' '-lequeue_ssl' '-lunix' '-lssl_stubs' '-lcrypto' '-lssl' '-lcamlstr' '-lnetaccel_c' '-lnetsys' '-lpthread' '-lbigarray' '-lunix' '-L/opt/local/lib' '-lpcre' '-lpcre_stubs' '-lcamlrun' -I'/opt/local/lib/ocaml' -lcurses -lpthread In fact, it works well with ocamlopt as you said. It's realy a problem of double link I searched a bit around this problem, but i don't find a way to fix it : the clang command line always call unix two times... (But i can test with a native version it's a beginning) 2011/12/29 Gerd Stolpmann <in...@ge...> > Hi, > > I cannot reproduce the problem (using my quite recent GODI > installation). That EINPROGRESS "breaks out" is quite strange, because > the HTTP connection is made via Uq_engines.direct_connector, and there > it is caught. > > A subtle problem I could imagine is that one of the libraries includes > unix.cma erroneously (i.e. the Unix module is defined twice), and > because of this there are two versions of Unix_error, and one cannot > catch this exception anymore. You could check this by running > ocamlobjinfo on the cma files, and looking whether a "Unit name" of Unix > occurs (should only be in unix.cma). (Btw: Do you see the problem also > for ocamlopt-compiled programs? cmxa's cannot be partially linked, > unlike cma's, so a linking problem is not possible.) > > My versions are: > > godi-atd-1.0.1godi1 Syntax for cross-language data types > godi-atdgen-1.2.2 Code generator for biniou and JSON > serialization > godi-biniou-1.0.0godi1 Flexible binary data format > godi-easy-format-1.0.0godi1 Indentation made easy(ier) > godi-ocaml-3.12.1godi2 The core of the OCaml system (compiler, > runtime) > godi-ocaml-src-3.12.1godi1 OCaml sources (required for GODI builds) > godi-ocaml-ssl-0.4.4godi2 The Secure Socket Layer > godi-ocamlnet-3.4.1 base library for network protocols > godi-ocamlnet-crypto-3.4.1 crypto extension for ocamlnet > godi-ocamlnet-ssl-3.4.1 SSL extension for ocamlnet > godi-pcre-6.2.3 Perl compatible regular expressions > godi-yojson-1.0.2godi1 JSON library succeeding to json-wheel > > We can enable debugging. I get then: > > # Http_client.Debug.enable := true;; > - : unit = () > # Http_client.Convenience.http_get "http://perdu.com";; > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP connection: > creating direct connection to perdu.com:80 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP > direct connection to perdu.com:80: Connected! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP Connection: > adding call 74 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call 74: > initialize transmitter > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - Call 74 - > HTTP request: GET / HTTP/1.1 > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP > connection: Got Call 74! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP > connection: pipelining=true persistency=false close_connection=false->false > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call 74 - > postprocessing > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP > connection: Shutdown! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP > connection: Closing socket! > [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP connection: > checking remaining pipeline requests > - : 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 êtes ici</pre></strong></body></html>\n" > > Gerd > > Am Freitag, den 23.12.2011, 16:11 +0100 schrieb Pierre-Alexandre Voye: > > 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 ê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 Oca...@li... > https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel > > > -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-29 13:52:12
|
Sometimes i wonder if i am not a bit stupid... It was simply i forgot cgi # output # commit_work(); Hope that help someone one day... 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> > I have now a backtrace : > Raised by primitive operation at file "netstream.ml", line 418, > characters 34-45 > Called from file "netchannels.ml", line 857, characters 14-36 > > netstream.ml: > 401 method input buf pos len = > 402 if s_closed then raise Netchannels.Closed_channel; > 403 if s_underrun then ( > 404 self # want_minimum(); (* may raise Buffer_underrun *) > 405 s_underrun <- false; > 406 ); > 407 (* Assertion: Either window length >= minimum, or eof *) > 408 let len' = min len s_winlen in > 409 Netbuffer.blit s_netbuf 0 buf pos len'; > 410 s # skip len'; (* never raises Buffer_underrun *) > 411 s_pos <- s_pos + len'; > 412 ( try > 413 self # want_minimum(); > 414 with > 415 Buffer_underrun -> > 416 s_underrun <- true > 417 ); > 418 if len'=0 && len>0 then raise End_of_file; > 419 len' > > > 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> > >> Still playing with it, and i got a server error now, impossible to get a >> backtrace >> >> I get : >> [Thu Dec 29 12:04:27 2011] [nethttpd] [err] [127.0.0.1:54702] [POST >> /upload] Nethttpd: Missing response, replying 'Server Error' >> >> >> The change in the CGI : i have just change the line which process the >> post result, by printing the content >> >> let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = >> try >> let out = cgi # output # output_string in >> let server_file arg = >> match arg#store with >> | `File fn -> fn >> | `Memory -> failwith "Not stored in a file" in >> match cgi#request_method with >> | `POST -> prerr_string (cgi#argument_value "content"); >> cgi#finalize(); () >> >> | _ -> cgi#output#output_string "Server accepts POST >> requests only.\n"; >> >> cgi # set_header ~cache:`No_cache >> ~content_type:"text/html; charset=\"iso-8859-1\"" (); >> cgi # output # commit_work();raise Erreur_durant_L_upload_Post >> with >> error -> cgi # output # rollback_work(); >> >> cgi # set_header >> ~status:`Forbidden (* Indicate the error *) >> >> ~cache:`No_cache >> ~content_type:"text/html; charset=\"utf-8\"" >> (); >> (* An error has happened. Generate now an error page instead of the >> current page. By rolling back the output buffer, any uncomitted material >> is deleted.*) >> >> >> cgi # output # output_string "While processing the request an >> O'Caml exception has been raised:<BR>"; >> cgi # output # output_string ("<TT>" ^ (Printexc.to_string >> error)^ (Printexc.get_backtrace ()) ^ "</TT><BR>"); >> >> (* Now commit the error page: *) >> cgi # output # commit_work() ; raise Erreur_durant_L_upload >> ;; >> >> >> >> 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> >> >>> Hello, >>> i'm writing code to manage upload from a browser. Even if I use a >>> XmlHttpRequest, i cannot fully control the http request to the server >>> >>> When i try to validate it with curl i have a strange error. >>> Here's the curl command line (which use attached file): >>> curl -F "file=@404.html;filename=404.html" http://localhost:8111/upload--trace-ascii - >>> >>> I suppose Curl respect the standard. But it's certainly my code which is >>> not wrote like it should. >>> >>> Here's my CGI (I know I have to use NetMime, but I don't understand >>> enought NetMime to use it) : >>> >>> let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = >>> try >>> let out = cgi # output # output_string in >>> let server_file arg = >>> match arg#store with >>> | `File fn -> fn >>> | `Memory -> failwith "Not stored in a file" in >>> match cgi#request_method with >>> | `POST -> traite_upload { nom_fichier = cgi#argument_value >>> "filename" ; contentType = cgi#argument_value "contentType" ; content = >>> cgi#argument_value "content"; filenametmp = server_file (cgi#argument >>> (cgi#argument_value "filename") ) } ; (*cgi#finalize();*) >>> | _ -> cgi#output#output_string "Server accepts POST requests >>> only.\n"; >>> >>> cgi # set_header ~cache:`No_cache >>> ~content_type:"text/html; charset=\"iso-8859-1\"" (); >>> cgi # output # commit_work();raise Erreur_durant_L_upload_Post >>> with >>> error -> cgi # output # rollback_work(); >>> >>> cgi # set_header >>> ~status:`Forbidden >>> ~cache:`No_cache >>> ~content_type:"text/html; charset=\"utf-8\"" >>> (); >>> >>> cgi # output # output_string "While processing the request an >>> O'Caml exception has been raised:<BR>"; >>> cgi # output # output_string ("<TT>" ^ (Printexc.to_string >>> error)^ (Printexc.get_backtrace ()) ^ "</TT><BR>"); >>> >>> (* Now commit the error page: *) >>> cgi # output # commit_work() ; raise Erreur_durant_L_upload >>> ;; >>> >>> Here the backtrace I have : >>> Not_found >>> Raised by primitive operation at file "map.ml", line 118, characters >>> 16-25. Called from file "netmime.ml", line 326, characters 14-31. >>> So it's in update_multiple_field method >>> >>> >>> >>> For information, here's the transcript of curl session : >>> >>> $ curl -F "file=@404.html;filename=404.html" >>> http://localhost:8111/upload --trace-ascii - >>> == Info: About to connect() to localhost port 8111 (#0) >>> == Info: Trying ::1... == Info: Connection refused >>> == Info: Trying 127.0.0.1... == Info: connected >>> => Send header, 296 bytes (0x128) >>> 0000: POST /upload HTTP/1.1 >>> 0017: User-Agent: curl/7.23.1 (x86_64-apple-darwin11.2.0) libcurl/7.23 >>> 0057: .1 OpenSSL/1.0.0e zlib/1.2.5 libidn/1.22 >>> 0081: Host: localhost:8111 >>> 0097: Accept: */* >>> 00a4: Content-Length: 1541 >>> 00ba: Expect: 100-continue >>> 00d0: Content-Type: multipart/form-data; boundary=-------------------- >>> 0110: --------402388b44fe6 >>> 0126: >>> <= Recv header, 23 bytes (0x17) >>> 0000: HTTP/1.1 100 Continue >>> => Send data, 137 bytes (0x89) >>> 0000: ------------------------------402388b44fe6 >>> 002c: Content-Disposition: form-data; name="file"; filename="404.html" >>> 006e: Content-Type: text/html >>> 0087: >>> => Send data, 1356 bytes (0x54c) >>> 0000: <!doctype html>.<html>.<head>. <meta charset="utf-8">. <title> >>> 0040: Page Not Found :(</title>. <style>.. body { text-align: center >>> 0080: ;}.. h1 { font-size: 50px; text-align: center }.. span[frown] >>> 00c0: { transform: rotate(90deg); display:inline-block; color: #bbb; } >>> 0100: .. body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon >>> 0140: Pro", Baskerville, Georgia, Times, serif; color: #999; text-sha >>> 0180: dow: 2px 2px 2px rgba(200, 200, 200, 0.5); }.. ::-moz-selection >>> 01c0: { background:#FF5E99; color:#fff; }.. ::selection { background: >>> 0200: #FF5E99; color:#fff; } .. article {display:block; text-align: l >>> 0240: eft; width: 500px; margin: 0 auto; }.. .. a { color: rgb(36, 1 >>> 0280: 09, 56); text-decoration:none; }.. a:hover { color: rgb(96, 73, >>> 02c0: 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }. </s >>> 0300: tyle>.</head>.<body>. <article>.. <h1>Not found <span frown >>> 0340: >:(</span></h1>.. <div>.. <p>Sorry, but the page you wer >>> 0380: e trying to view does not exist.</p>.. <p>It looks like th >>> 03c0: is was the result of either:</p>.. <ul>... <li>a mistype >>> 0400: d address</li>... <li>an out-of-date link</li>.. </ul>.. >>> 0440: </div>.. .. <script>.. var GOOG_FIXURL_LANG = (navig >>> 0480: ator.language || '').slice(0,2),...GOOG_FIXURL_SITE = location.h >>> 04c0: ost;.. </script>.. <script src="http://linkhelp.clients.go >>> 0500: ogle.com/tbproxy/lh/wm/fixurl.js"></script>. </article>.</bo >>> 0540: dy>.</html>. >>> => Send data, 48 bytes (0x30) >>> 0000: >>> 0002: ------------------------------402388b44fe6-- >>> <= Recv header, 24 bytes (0x18) >>> 0000: HTTP/1.1 403 Forbidden >>> <= Recv header, 42 bytes (0x2a) >>> 0000: Content-Type: text/html; charset="utf-8" >>> <= Recv header, 25 bytes (0x19) >>> 0000: Cache-control: no-cache >>> <= Recv header, 18 bytes (0x12) >>> 0000: Pragma: no-cache >>> <= Recv header, 42 bytes (0x2a) >>> 0000: Expires: Thu, 29 Dec 2011 09:49:25 +0000 >>> <= Recv header, 28 bytes (0x1c) >>> 0000: Transfer-Encoding: chunked >>> <= Recv header, 37 bytes (0x25) >>> 0000: Date: Thu, 29 Dec 2011 09:49:26 GMT >>> <= Recv header, 24 bytes (0x18) >>> 0000: Server: Ocamlnet/3.4.1 >>> == Info: HTTP error before end of send, stop sending >>> <= Recv header, 2 bytes (0x2) >>> 0000: >>> <= Recv data, 228 bytes (0xe4) >>> 0000: e0 >>> 0004: While processing the request an O'Caml exception has been raised >>> 0044: :<BR><TT>Not_foundRaised by primitive operation at file "map.ml" >>> 0084: , line 118, characters 16-25.Called from file "netmime.ml", line >>> 00c4: 326, characters 14-31.</TT><BR> >>> While processing the request an O'Caml exception has been >>> raised:<BR><TT>Not_foundRaised by primitive operation at file "map.ml", >>> line 118, characters 16-25 >>> Called from file "netmime.ml", line 326, characters 14-31 >>> </TT><BR><= Recv data, 2 bytes (0x2) >>> 0000: >>> == Info: transfer closed with outstanding read data remaining >>> == Info: Closing connection #0 >>> curl: (18) transfer closed with outstanding read data remaining >>> >>> >>> Thank you >>> >>> -- >>> --------------------- >>> https://twitter.com/#!/ontologiae/ >>> http://linuxfr.org/users/montaigne >>> >>> >> >> >> -- >> --------------------- >> https://twitter.com/#!/ontologiae/ >> http://linuxfr.org/users/montaigne >> >> > > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-29 13:09:46
|
I have now a backtrace : Raised by primitive operation at file "netstream.ml", line 418, characters 34-45 Called from file "netchannels.ml", line 857, characters 14-36 netstream.ml: 401 method input buf pos len = 402 if s_closed then raise Netchannels.Closed_channel; 403 if s_underrun then ( 404 self # want_minimum(); (* may raise Buffer_underrun *) 405 s_underrun <- false; 406 ); 407 (* Assertion: Either window length >= minimum, or eof *) 408 let len' = min len s_winlen in 409 Netbuffer.blit s_netbuf 0 buf pos len'; 410 s # skip len'; (* never raises Buffer_underrun *) 411 s_pos <- s_pos + len'; 412 ( try 413 self # want_minimum(); 414 with 415 Buffer_underrun -> 416 s_underrun <- true 417 ); 418 if len'=0 && len>0 then raise End_of_file; 419 len' 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> > Still playing with it, and i got a server error now, impossible to get a > backtrace > > I get : > [Thu Dec 29 12:04:27 2011] [nethttpd] [err] [127.0.0.1:54702] [POST > /upload] Nethttpd: Missing response, replying 'Server Error' > > > The change in the CGI : i have just change the line which process the post > result, by printing the content > > let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = > try > let out = cgi # output # output_string in > let server_file arg = > match arg#store with > | `File fn -> fn > | `Memory -> failwith "Not stored in a file" in > match cgi#request_method with > | `POST -> prerr_string (cgi#argument_value "content"); > cgi#finalize(); () > > | _ -> cgi#output#output_string "Server accepts POST > requests only.\n"; > > cgi # set_header ~cache:`No_cache > ~content_type:"text/html; charset=\"iso-8859-1\"" (); > cgi # output # commit_work();raise Erreur_durant_L_upload_Post > with > error -> cgi # output # rollback_work(); > > cgi # set_header > ~status:`Forbidden (* Indicate the error *) > > ~cache:`No_cache > ~content_type:"text/html; charset=\"utf-8\"" > (); > (* An error has happened. Generate now an error page instead of the > current page. By rolling back the output buffer, any uncomitted material > is deleted.*) > > > cgi # output # output_string "While processing the request an > O'Caml exception has been raised:<BR>"; > cgi # output # output_string ("<TT>" ^ (Printexc.to_string error)^ > (Printexc.get_backtrace ()) ^ "</TT><BR>"); > > (* Now commit the error page: *) > cgi # output # commit_work() ; raise Erreur_durant_L_upload > ;; > > > > 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> > >> Hello, >> i'm writing code to manage upload from a browser. Even if I use a >> XmlHttpRequest, i cannot fully control the http request to the server >> >> When i try to validate it with curl i have a strange error. >> Here's the curl command line (which use attached file): >> curl -F "file=@404.html;filename=404.html" http://localhost:8111/upload--trace-ascii - >> >> I suppose Curl respect the standard. But it's certainly my code which is >> not wrote like it should. >> >> Here's my CGI (I know I have to use NetMime, but I don't understand >> enought NetMime to use it) : >> >> let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = >> try >> let out = cgi # output # output_string in >> let server_file arg = >> match arg#store with >> | `File fn -> fn >> | `Memory -> failwith "Not stored in a file" in >> match cgi#request_method with >> | `POST -> traite_upload { nom_fichier = cgi#argument_value >> "filename" ; contentType = cgi#argument_value "contentType" ; content = >> cgi#argument_value "content"; filenametmp = server_file (cgi#argument >> (cgi#argument_value "filename") ) } ; (*cgi#finalize();*) >> | _ -> cgi#output#output_string "Server accepts POST requests >> only.\n"; >> >> cgi # set_header ~cache:`No_cache >> ~content_type:"text/html; charset=\"iso-8859-1\"" (); >> cgi # output # commit_work();raise Erreur_durant_L_upload_Post >> with >> error -> cgi # output # rollback_work(); >> >> cgi # set_header >> ~status:`Forbidden >> ~cache:`No_cache >> ~content_type:"text/html; charset=\"utf-8\"" >> (); >> >> cgi # output # output_string "While processing the request an >> O'Caml exception has been raised:<BR>"; >> cgi # output # output_string ("<TT>" ^ (Printexc.to_string >> error)^ (Printexc.get_backtrace ()) ^ "</TT><BR>"); >> >> (* Now commit the error page: *) >> cgi # output # commit_work() ; raise Erreur_durant_L_upload >> ;; >> >> Here the backtrace I have : >> Not_found >> Raised by primitive operation at file "map.ml", line 118, characters >> 16-25. Called from file "netmime.ml", line 326, characters 14-31. >> So it's in update_multiple_field method >> >> >> >> For information, here's the transcript of curl session : >> >> $ curl -F "file=@404.html;filename=404.html" >> http://localhost:8111/upload --trace-ascii - >> == Info: About to connect() to localhost port 8111 (#0) >> == Info: Trying ::1... == Info: Connection refused >> == Info: Trying 127.0.0.1... == Info: connected >> => Send header, 296 bytes (0x128) >> 0000: POST /upload HTTP/1.1 >> 0017: User-Agent: curl/7.23.1 (x86_64-apple-darwin11.2.0) libcurl/7.23 >> 0057: .1 OpenSSL/1.0.0e zlib/1.2.5 libidn/1.22 >> 0081: Host: localhost:8111 >> 0097: Accept: */* >> 00a4: Content-Length: 1541 >> 00ba: Expect: 100-continue >> 00d0: Content-Type: multipart/form-data; boundary=-------------------- >> 0110: --------402388b44fe6 >> 0126: >> <= Recv header, 23 bytes (0x17) >> 0000: HTTP/1.1 100 Continue >> => Send data, 137 bytes (0x89) >> 0000: ------------------------------402388b44fe6 >> 002c: Content-Disposition: form-data; name="file"; filename="404.html" >> 006e: Content-Type: text/html >> 0087: >> => Send data, 1356 bytes (0x54c) >> 0000: <!doctype html>.<html>.<head>. <meta charset="utf-8">. <title> >> 0040: Page Not Found :(</title>. <style>.. body { text-align: center >> 0080: ;}.. h1 { font-size: 50px; text-align: center }.. span[frown] >> 00c0: { transform: rotate(90deg); display:inline-block; color: #bbb; } >> 0100: .. body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon >> 0140: Pro", Baskerville, Georgia, Times, serif; color: #999; text-sha >> 0180: dow: 2px 2px 2px rgba(200, 200, 200, 0.5); }.. ::-moz-selection >> 01c0: { background:#FF5E99; color:#fff; }.. ::selection { background: >> 0200: #FF5E99; color:#fff; } .. article {display:block; text-align: l >> 0240: eft; width: 500px; margin: 0 auto; }.. .. a { color: rgb(36, 1 >> 0280: 09, 56); text-decoration:none; }.. a:hover { color: rgb(96, 73, >> 02c0: 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }. </s >> 0300: tyle>.</head>.<body>. <article>.. <h1>Not found <span frown >> 0340: >:(</span></h1>.. <div>.. <p>Sorry, but the page you wer >> 0380: e trying to view does not exist.</p>.. <p>It looks like th >> 03c0: is was the result of either:</p>.. <ul>... <li>a mistype >> 0400: d address</li>... <li>an out-of-date link</li>.. </ul>.. >> 0440: </div>.. .. <script>.. var GOOG_FIXURL_LANG = (navig >> 0480: ator.language || '').slice(0,2),...GOOG_FIXURL_SITE = location.h >> 04c0: ost;.. </script>.. <script src="http://linkhelp.clients.go >> 0500: ogle.com/tbproxy/lh/wm/fixurl.js"></script>. </article>.</bo >> 0540: dy>.</html>. >> => Send data, 48 bytes (0x30) >> 0000: >> 0002: ------------------------------402388b44fe6-- >> <= Recv header, 24 bytes (0x18) >> 0000: HTTP/1.1 403 Forbidden >> <= Recv header, 42 bytes (0x2a) >> 0000: Content-Type: text/html; charset="utf-8" >> <= Recv header, 25 bytes (0x19) >> 0000: Cache-control: no-cache >> <= Recv header, 18 bytes (0x12) >> 0000: Pragma: no-cache >> <= Recv header, 42 bytes (0x2a) >> 0000: Expires: Thu, 29 Dec 2011 09:49:25 +0000 >> <= Recv header, 28 bytes (0x1c) >> 0000: Transfer-Encoding: chunked >> <= Recv header, 37 bytes (0x25) >> 0000: Date: Thu, 29 Dec 2011 09:49:26 GMT >> <= Recv header, 24 bytes (0x18) >> 0000: Server: Ocamlnet/3.4.1 >> == Info: HTTP error before end of send, stop sending >> <= Recv header, 2 bytes (0x2) >> 0000: >> <= Recv data, 228 bytes (0xe4) >> 0000: e0 >> 0004: While processing the request an O'Caml exception has been raised >> 0044: :<BR><TT>Not_foundRaised by primitive operation at file "map.ml" >> 0084: , line 118, characters 16-25.Called from file "netmime.ml", line >> 00c4: 326, characters 14-31.</TT><BR> >> While processing the request an O'Caml exception has been >> raised:<BR><TT>Not_foundRaised by primitive operation at file "map.ml", >> line 118, characters 16-25 >> Called from file "netmime.ml", line 326, characters 14-31 >> </TT><BR><= Recv data, 2 bytes (0x2) >> 0000: >> == Info: transfer closed with outstanding read data remaining >> == Info: Closing connection #0 >> curl: (18) transfer closed with outstanding read data remaining >> >> >> Thank you >> >> -- >> --------------------- >> https://twitter.com/#!/ontologiae/ >> http://linuxfr.org/users/montaigne >> >> > > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-29 11:14:46
|
Still playing with it, and i got a server error now, impossible to get a backtrace I get : [Thu Dec 29 12:04:27 2011] [nethttpd] [err] [127.0.0.1:54702] [POST /upload] Nethttpd: Missing response, replying 'Server Error' The change in the CGI : i have just change the line which process the post result, by printing the content let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = try let out = cgi # output # output_string in let server_file arg = match arg#store with | `File fn -> fn | `Memory -> failwith "Not stored in a file" in match cgi#request_method with | `POST -> prerr_string (cgi#argument_value "content"); cgi#finalize(); () | _ -> cgi#output#output_string "Server accepts POST requests only.\n"; cgi # set_header ~cache:`No_cache ~content_type:"text/html; charset=\"iso-8859-1\"" (); cgi # output # commit_work();raise Erreur_durant_L_upload_Post with error -> cgi # output # rollback_work(); cgi # set_header ~status:`Forbidden (* Indicate the error *) ~cache:`No_cache ~content_type:"text/html; charset=\"utf-8\"" (); (* An error has happened. Generate now an error page instead of the current page. By rolling back the output buffer, any uncomitted material is deleted.*) cgi # output # output_string "While processing the request an O'Caml exception has been raised:<BR>"; cgi # output # output_string ("<TT>" ^ (Printexc.to_string error)^ (Printexc.get_backtrace ()) ^ "</TT><BR>"); (* Now commit the error page: *) cgi # output # commit_work() ; raise Erreur_durant_L_upload ;; 2011/12/29 Pierre-Alexandre Voye <ont...@gm...> > Hello, > i'm writing code to manage upload from a browser. Even if I use a > XmlHttpRequest, i cannot fully control the http request to the server > > When i try to validate it with curl i have a strange error. > Here's the curl command line (which use attached file): > curl -F "file=@404.html;filename=404.html" http://localhost:8111/upload--trace-ascii - > > I suppose Curl respect the standard. But it's certainly my code which is > not wrote like it should. > > Here's my CGI (I know I have to use NetMime, but I don't understand > enought NetMime to use it) : > > let defini_CGI_Upload (cgi : Netcgi.cgi_activation) = > try > let out = cgi # output # output_string in > let server_file arg = > match arg#store with > | `File fn -> fn > | `Memory -> failwith "Not stored in a file" in > match cgi#request_method with > | `POST -> traite_upload { nom_fichier = cgi#argument_value > "filename" ; contentType = cgi#argument_value "contentType" ; content = > cgi#argument_value "content"; filenametmp = server_file (cgi#argument > (cgi#argument_value "filename") ) } ; (*cgi#finalize();*) > | _ -> cgi#output#output_string "Server accepts POST requests > only.\n"; > > cgi # set_header ~cache:`No_cache > ~content_type:"text/html; charset=\"iso-8859-1\"" (); > cgi # output # commit_work();raise Erreur_durant_L_upload_Post > with > error -> cgi # output # rollback_work(); > > cgi # set_header > ~status:`Forbidden > ~cache:`No_cache > ~content_type:"text/html; charset=\"utf-8\"" > (); > > cgi # output # output_string "While processing the request an > O'Caml exception has been raised:<BR>"; > cgi # output # output_string ("<TT>" ^ (Printexc.to_string error)^ > (Printexc.get_backtrace ()) ^ "</TT><BR>"); > > (* Now commit the error page: *) > cgi # output # commit_work() ; raise Erreur_durant_L_upload > ;; > > Here the backtrace I have : > Not_found > Raised by primitive operation at file "map.ml", line 118, characters > 16-25. Called from file "netmime.ml", line 326, characters 14-31. > So it's in update_multiple_field method > > > > For information, here's the transcript of curl session : > > $ curl -F "file=@404.html;filename=404.html" http://localhost:8111/upload--trace-ascii - > == Info: About to connect() to localhost port 8111 (#0) > == Info: Trying ::1... == Info: Connection refused > == Info: Trying 127.0.0.1... == Info: connected > => Send header, 296 bytes (0x128) > 0000: POST /upload HTTP/1.1 > 0017: User-Agent: curl/7.23.1 (x86_64-apple-darwin11.2.0) libcurl/7.23 > 0057: .1 OpenSSL/1.0.0e zlib/1.2.5 libidn/1.22 > 0081: Host: localhost:8111 > 0097: Accept: */* > 00a4: Content-Length: 1541 > 00ba: Expect: 100-continue > 00d0: Content-Type: multipart/form-data; boundary=-------------------- > 0110: --------402388b44fe6 > 0126: > <= Recv header, 23 bytes (0x17) > 0000: HTTP/1.1 100 Continue > => Send data, 137 bytes (0x89) > 0000: ------------------------------402388b44fe6 > 002c: Content-Disposition: form-data; name="file"; filename="404.html" > 006e: Content-Type: text/html > 0087: > => Send data, 1356 bytes (0x54c) > 0000: <!doctype html>.<html>.<head>. <meta charset="utf-8">. <title> > 0040: Page Not Found :(</title>. <style>.. body { text-align: center > 0080: ;}.. h1 { font-size: 50px; text-align: center }.. span[frown] > 00c0: { transform: rotate(90deg); display:inline-block; color: #bbb; } > 0100: .. body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon > 0140: Pro", Baskerville, Georgia, Times, serif; color: #999; text-sha > 0180: dow: 2px 2px 2px rgba(200, 200, 200, 0.5); }.. ::-moz-selection > 01c0: { background:#FF5E99; color:#fff; }.. ::selection { background: > 0200: #FF5E99; color:#fff; } .. article {display:block; text-align: l > 0240: eft; width: 500px; margin: 0 auto; }.. .. a { color: rgb(36, 1 > 0280: 09, 56); text-decoration:none; }.. a:hover { color: rgb(96, 73, > 02c0: 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }. </s > 0300: tyle>.</head>.<body>. <article>.. <h1>Not found <span frown > 0340: >:(</span></h1>.. <div>.. <p>Sorry, but the page you wer > 0380: e trying to view does not exist.</p>.. <p>It looks like th > 03c0: is was the result of either:</p>.. <ul>... <li>a mistype > 0400: d address</li>... <li>an out-of-date link</li>.. </ul>.. > 0440: </div>.. .. <script>.. var GOOG_FIXURL_LANG = (navig > 0480: ator.language || '').slice(0,2),...GOOG_FIXURL_SITE = location.h > 04c0: ost;.. </script>.. <script src="http://linkhelp.clients.go > 0500: ogle.com/tbproxy/lh/wm/fixurl.js"></script>. </article>.</bo > 0540: dy>.</html>. > => Send data, 48 bytes (0x30) > 0000: > 0002: ------------------------------402388b44fe6-- > <= Recv header, 24 bytes (0x18) > 0000: HTTP/1.1 403 Forbidden > <= Recv header, 42 bytes (0x2a) > 0000: Content-Type: text/html; charset="utf-8" > <= Recv header, 25 bytes (0x19) > 0000: Cache-control: no-cache > <= Recv header, 18 bytes (0x12) > 0000: Pragma: no-cache > <= Recv header, 42 bytes (0x2a) > 0000: Expires: Thu, 29 Dec 2011 09:49:25 +0000 > <= Recv header, 28 bytes (0x1c) > 0000: Transfer-Encoding: chunked > <= Recv header, 37 bytes (0x25) > 0000: Date: Thu, 29 Dec 2011 09:49:26 GMT > <= Recv header, 24 bytes (0x18) > 0000: Server: Ocamlnet/3.4.1 > == Info: HTTP error before end of send, stop sending > <= Recv header, 2 bytes (0x2) > 0000: > <= Recv data, 228 bytes (0xe4) > 0000: e0 > 0004: While processing the request an O'Caml exception has been raised > 0044: :<BR><TT>Not_foundRaised by primitive operation at file "map.ml" > 0084: , line 118, characters 16-25.Called from file "netmime.ml", line > 00c4: 326, characters 14-31.</TT><BR> > While processing the request an O'Caml exception has been > raised:<BR><TT>Not_foundRaised by primitive operation at file "map.ml", > line 118, characters 16-25 > Called from file "netmime.ml", line 326, characters 14-31 > </TT><BR><= Recv data, 2 bytes (0x2) > 0000: > == Info: transfer closed with outstanding read data remaining > == Info: Closing connection #0 > curl: (18) transfer closed with outstanding read data remaining > > > Thank you > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-29 10:10:14
|
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Page Not Found :(</title> <style> body { text-align: center;} h1 { font-size: 50px; text-align: center } span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; } body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); } ::-moz-selection{ background:#FF5E99; color:#fff; } ::selection { background:#FF5E99; color:#fff; } article {display:block; text-align: left; width: 500px; margin: 0 auto; } a { color: rgb(36, 109, 56); text-decoration:none; } a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); } </style> </head> <body> <article> <h1>Not found <span frown>:(</span></h1> <div> <p>Sorry, but the page you were trying to view does not exist.</p> <p>It looks like this was the result of either:</p> <ul> <li>a mistyped address</li> <li>an out-of-date link</li> </ul> </div> <script> var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2), GOOG_FIXURL_SITE = location.host; </script> <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script> </article> </body> </html> |
From: Gerd S. <in...@ge...> - 2011-12-28 23:32:58
|
Hi, I cannot reproduce the problem (using my quite recent GODI installation). That EINPROGRESS "breaks out" is quite strange, because the HTTP connection is made via Uq_engines.direct_connector, and there it is caught. A subtle problem I could imagine is that one of the libraries includes unix.cma erroneously (i.e. the Unix module is defined twice), and because of this there are two versions of Unix_error, and one cannot catch this exception anymore. You could check this by running ocamlobjinfo on the cma files, and looking whether a "Unit name" of Unix occurs (should only be in unix.cma). (Btw: Do you see the problem also for ocamlopt-compiled programs? cmxa's cannot be partially linked, unlike cma's, so a linking problem is not possible.) My versions are: godi-atd-1.0.1godi1 Syntax for cross-language data types godi-atdgen-1.2.2 Code generator for biniou and JSON serialization godi-biniou-1.0.0godi1 Flexible binary data format godi-easy-format-1.0.0godi1 Indentation made easy(ier) godi-ocaml-3.12.1godi2 The core of the OCaml system (compiler, runtime) godi-ocaml-src-3.12.1godi1 OCaml sources (required for GODI builds) godi-ocaml-ssl-0.4.4godi2 The Secure Socket Layer godi-ocamlnet-3.4.1 base library for network protocols godi-ocamlnet-crypto-3.4.1 crypto extension for ocamlnet godi-ocamlnet-ssl-3.4.1 SSL extension for ocamlnet godi-pcre-6.2.3 Perl compatible regular expressions godi-yojson-1.0.2godi1 JSON library succeeding to json-wheel We can enable debugging. I get then: # Http_client.Debug.enable := true;; - : unit = () # Http_client.Convenience.http_get "http://perdu.com";; [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP connection: creating direct connection to perdu.com:80 [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP direct connection to perdu.com:80: Connected! [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP Connection: adding call 74 [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call 74: initialize transmitter [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - Call 74 - HTTP request: GET / HTTP/1.1 [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP connection: Got Call 74! [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP connection: pipelining=true persistency=false close_connection=false->false [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: Call 74 - postprocessing [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP connection: Shutdown! [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: FD 3 - HTTP connection: Closing socket! [Thu Dec 29 00:17:20 2011] [debug] [32146:0] Http_client: HTTP connection: checking remaining pipeline requests - : 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 êtes ici</pre></strong></body></html>\n" Gerd Am Freitag, den 23.12.2011, 16:11 +0100 schrieb Pierre-Alexandre Voye: > 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 ê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 Oca...@li... https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel |
From: Paolo D. <p.d...@gm...> - 2011-12-24 13:51:00
|
Sorry for cross posting in two mailing lists, but I'm going mad with SELinux on a server of mine equipped with CentOS 6.2. The problem is to run a FastCGI netplex application in peace with Apache and SELinux. Apache and the application communicate using a socket, provided by netplex. In the default Linux environment there are no problems. Here, the httpd daemon can't write to the socket, and the application simply never receives requests. The application context is this: *# ls -laZ -rwxr-xr-x. root root system_u:object_r:httpd_sys_script_exec_t:s0 devel.donadeo.net* but when I start the program, ps shows a different story: *# ./devel.donadeo.net --config-file /var/www/ donadeo.net/devel/blog_prod.conf # ps faxeZ* *... [ only relevant processes ] ... **unconfined_u:system_r:httpd_t:s0 16048 ? Ss 0:00 /usr/sbin/httpd <- Apache unconfined_u:system_r:httpd_t:s0 20293 ? S 0:00 \_ /usr/sbin/fcgi- <- mod_fastcgi unconfined_u:system_r:httpd_t:s0 20294 ? S 0:00 \_ /usr/sbin/httpd **<- other 10 Apache workers** ... ... ... unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 21501 ? Ss 0:00 ./ devel.donadeo.net --config-file /var/www/donadeo.net/devel/blog_prod.conf unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 21502 ? S 0:00 \_ ./devel.donadeo.net --config-file /var/www/donadeo.net/devel/blog_prod.conf * while the communication socket is labelled like this: *# ls -laZ srwxr-xr-x. root root unconfined_u:object_r:httpd_sys_content_t:s0server.sock * The first question is: why the hell the executable devel.donadeo.net is labelled with "system_u:object_r:httpd_sys_script_exec_t:s0" and the corresponding process in memory runs with a very low "unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023"? Of course an unconfined process cannot write to a socket labelled "unconfined_u:object_r:httpd_sys_content_t:s0". Any idea, before I disable SELinux altogether? I like the security framework, but I don't want to loose my mental sanity for it. -- *Paolo* |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-23 15:11:39
|
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 ê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 |
From: Gerd S. <in...@ge...> - 2011-12-14 13:17:36
|
Hello Pierre-Alexandre, netcgi parses POSTed arguments already for you. You can simply access them with the normal cgi#argument mechanism. E.g. to get the result of a file upload named "upload": let arg = cgi#argument "upload" To read the uploaded data into a string: let data = arg#value To get the (server) filename where the uploaded data is temporarily stored: let server_file = match arg#store with | `File fn -> fn | `Memory -> failwith "Not stored in a file" There are a few more methods for arguments, see the docs. Don't forget to finally delete the temporary files where the uploads are stored. This can easily be done with cgi#finalize() Hope this helps, Gerd Am Montag, den 12.12.2011, 18:53 +0100 schrieb Pierre-Alexandre Voye: > Hello, > > I'm trying to finding my path to uploading a file via HTTP/POST, by > parsing a multipart form data, and i have to admit i'm lost. > > I start from a netcgi, which with i can handle argument > let process (cgi : Netcgi.cgi_activation) = > try > let out = cgi # output # output_string in > match cgi#request_method with > | `POST -> let t = > cgi#environment#input_header() in out "rrrhh" > cgi # output # commit_work(); > with > error -> print_endline "toto" > ;; > > As far as i understand, i have to get the raw data, and to parse it > with Netmime module, > so my value "t" which contains cgi#environment#input_header() would > contains interesting data, but the type Netmime.mime_header only > provide methods to modify data.. > > Does anyone could give a hook to find a path ? > > Thank you very much, > > Regards, > > P-A > > > > -- > --------------------- > https://twitter.com/#!/ontologiae/ > http://linuxfr.org/users/montaigne > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > _______________________________________________ Ocamlnet-devel mailing list Oca...@li... https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel |
From: Pierre-Alexandre V. <ont...@gm...> - 2011-12-12 17:54:21
|
Hello, I'm trying to finding my path to uploading a file via HTTP/POST, by parsing a multipart form data, and i have to admit i'm lost. I start from a netcgi, which with i can handle argument let process (cgi : Netcgi.cgi_activation) = try let out = cgi # output # output_string in match cgi#request_method with | `POST -> let t = cgi#environment#input_header() in out "rrrhh" cgi # output # commit_work(); with error -> print_endline "toto" ;; As far as i understand, i have to get the raw data, and to parse it with Netmime module, so my value "t" which contains cgi#environment#input_header() would contains interesting data, but the type Netmime.mime_header only provide methods to modify data.. Does anyone could give a hook to find a path ? Thank you very much, Regards, P-A -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |
From: Gerd S. <in...@ge...> - 2011-08-30 19:34:51
|
Hi, A new version of Ocamlnet has been released: Version 3.4 mainly focuses on smaller usability improvements: - Ocamlnet has been ported to IPv6 (or better, this project is now done) - The apache module understands now a NetcgiRequire directive which works in the same way as #require in the toploop. - The methods read_file and write_file have been added to the Netfs.stream_fs abstraction for accessing filesystems. These methods allow it to avoid temporary files in some cases. - Netplex prints now line numbers when emitting messages about errors in the config file. Plus some smaller changes (see ChangeLog). The project page with all relevant links (manual, download, etc): http://projects.camlcity.org/projects/ocamlnet.html GODI for Ocaml-3.12 is already updated. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |
From: Gerd S. <in...@ge...> - 2011-08-26 16:24:43
|
Am Freitag, den 26.08.2011, 15:11 +0100 schrieb Theodore Hong: > Hi, I'm glad to see that ocamlnet now supports HTTPS. Is it possible > to use client certificates with Https_client? I could only find > documentation for connections without user certificates. This is possible. The trick is to configure the SSL context accordingly. For example, to add a client certificate to ctx use Ssl.use_certificate ctx "certificate.pem" "certificate.key" where the latter two arguments are file names. There are a few more functions for client certificates in the Ssl module, see there for docs. Gerd > > Thanks, > Theo > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Ocamlnet-devel mailing list > Oca...@li... > https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |