diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./config/configure.in ./config/configure.in
--- ./config/configure.in	2005-09-14 23:04:10.000000000 +0200
+++ ./config/configure.in	2005-09-22 17:14:31.000000000 +0200
@@ -17,45 +17,63 @@
 
 OS_FILES=unix
 OS_FILES2=unix
+SYSTEM=unknown
 case $host in
   *mingw*)
+    SYSTEM=mingw
     OS_FILES=mingw
     OS_FILES2=mingw
     PTHREAD_LIBS="-lpthreadGC2 -lwsock32"
     PTHREAD_CFLAGS="-DPTW32_STATIC_LIB"
     ;;
   *cygwin*)
+    SYSTEM=cygwin
     OS_FILES2=cygwin
     ;;
-  *freebsd*|*openbsd*)
+  *freebsd*)
+    SYSTEM=freebsd
     CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
     LDFLAGS="${LDFLAGS} -L/usr/local/lib"
     ;;
+  *openbsd*)
+    SYSTEM=openbsd
+    CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
+    LDFLAGS="${LDFLAGS} -L/usr/local/lib"
+    ;;
+  *netbsd*)
+    SYSTEM=netbsd
+    ;;
+  *linux*)
+    SYSTEM=linux
+    ;;
+  *solaris*)
+    SYSTEM=solaris
+    ;;
+  *morphos*|*amigaos*)
+    SYSTEM=morphos
+    ;;
+  *aix*)
+    SYSTEM=aix
+    ;;
+  *beos*)
+    SYSTEM=beos
+    ;;
+  *osf*)
+    SYSTEM=osf
+    ;;
+  *irix*)
+    SYSTEM=irix
+    ;;
+  *hppa*|*hpux*)
+    SYSTEM=hpux
+    ;;
+  *darwin*|*rhapsody*|*macosx*)
+    SYSTEM=macosx
+    ;;
 esac
-
-case "`uname -s`" in
-  *win32* | *WIN32* | MINGW* | CYGWIN* )
-     SYSTEM="windows"
-     ;;
-  *Linux*)
-     SYSTEM="linux"
-     ;;
-  *FreeBSD*)
-     SYSTEM="freebsd"
-     ;;
-  *OpenBSD*)
-     SYSTEM="openbsd"
-     ;;
-  *SunOS*)
-     SYSTEM="solaris"
-     ;;
-  *Darwin*)
-     SYSTEM="darwin"
-     ;;
-  *)
-     SYSTEM=""
-     ;;
-esac
+if test "x$SYSTEM" = "xunknown"; then
+  AC_MSG_FAILURE([Unknown build system, please notify MLdonkey developer team])
+fi
 
 if test -d .svn; then
   AC_MSG_NOTICE(checking SVN revision)
@@ -67,6 +85,7 @@
        SCM_VERSION="cannot find out SVN revision (no SVNVERSION)"  
   fi     
 fi
+
 if test -f ./CVS/Entries ; then
   AC_MSG_NOTICE(checking CVS checkout date)
   AC_CHECK_PROG(STAT, stat, stat)
@@ -85,24 +104,27 @@
 	      SCM_VERSION=`$STAT -f %a ./CVS/Entries | $GREP -v Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\1-\2-\4 \3/'`
 	    fi
 	  else
-	    if [ test "$SYSTEM" = "windows"]; then
+	    if [ test "$SYSTEM" = "mingw"] || [ test "$SYSTEM" = "cygwin"]; then
 	      AC_CHECK_PROG(GREP, grep, grep)
 	      if test "$ac_cv_prog_GREP" = "grep"; then
 	        SCM_VERSION=`$STAT ./CVS/Entries  | $GREP Modify | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\5-\2-\3 \4/'`
+	      fi
+	    else
+	      SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c0-19`
 	    fi
-	  else
-	    SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c0-19`
 	  fi
 	fi
+      else
+        AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
+        SCM_VERSION="cannot find out SCM Version (no CUT)"
       fi
-      else AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
-      SCM_VERSION="cannot find out SCM Version (no CUT)"
+    else
+      AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
+      SCM_VERSION="cannot find out SCM Version (no SED)"
     fi
-    else AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
-    SCM_VERSION="cannot find out SCM Version (no SED)"
-  fi
-  else AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
-  SCM_VERSION="cannot find out SCM Version (no STAT)"
+  else
+    AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
+    SCM_VERSION="cannot find out SCM Version (no STAT)"
   fi
 fi
 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
@@ -138,7 +160,6 @@
 BITTORRENT=yes
 FASTTRACK=yes
 FILETP=yes
-BROOSNET=yes
 MULTINET=yes
 AC_ARG_ENABLE(multinet,      [  --disable-multinet      allows you to only compile support for edonkey + Overnet], [MULTINET="$enableval"])
 if test ! "$MULTINET" = "yes"; then
@@ -152,7 +173,6 @@
   FILETP=no
   BITTORRENT=no
   RELEASENAME="$RELEASENAME-nomultinet"
-  BROOSNET=no
 fi
 AC_ARG_ENABLE(donkey,        [  --disable-donkey        allows you to remove support for eDonkey], [DONKEY="$enableval"])
 AC_ARG_ENABLE(bittorrent,    [  --disable-bittorrent    allows you to remove support for Bittorent], [BITTORRENT="$enableval"])
@@ -226,8 +246,19 @@
 AC_PROG_CC
 AC_EXEEXT
 AC_PROG_CPP
+AC_PROG_CXX
+
+AC_CHECK_PROG(NEWCXX, [$CXX], [$CXX], [no])
+if test x"$NEWCXX" = x"no"
+then
+  AC_MSG_ERROR("No valid c++ compiler found")
+else
+  CXX=$NEWCXX
+fi
+
 if test "$FORCE_MINGW" = "yes"; then
     CC="$CC -mno-cygwin"
+    CPP="$CPP -mno-cygwin"
 fi
 AC_PROG_RANLIB
 
@@ -564,17 +595,9 @@
 #endif
 ])
 
-ZLIB=no
-AC_CHECK_LIB(z,inflate,[AC_CHECK_HEADERS(zlib.h,[ZLIB=yes],)])
-if test "$ZLIB" = "yes"; then
-  AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
-  HAS_ZLIB=true
-  ZLIB__UNCOMPRESS_STRING2="Zlib.uncompress_string2 s"
-  ZLIB__COMPRESS_STRING="Zlib.compress_string s"
-  ZLIB__GZIP_STRING="Zlib.gzip_string s"
-else
-  echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1
-fi
+AC_CHECK_LIB(z,inflate,,[AC_MSG_FAILURE([Zlib missing, did you install zlib and zlib-developer packages?])])
+AC_CHECK_HEADERS(zlib.h,,[AC_MSG_FAILURE([Zlib missing, did you install zlib and zlib-developer packages?])])
+AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
 
 BZIP2=no
 HAS_BZIP2=false
@@ -703,15 +726,10 @@
 fi
 AC_MSG_NOTICE(checking for activated networks)
   if test "$DONKEY" = "yes"; then
-    if test "$ZLIB" = "yes"; then
-       AC_CHECK_FILE(../src/networks/donkey,DONKEY=yes, [
-         DONKEY=no
-         BAD_TARGETS="$BAD_TARGETS donkey"
-       ])
-    else
-       DONKEY=no
-       BAD_TARGETS="$BAD_TARGETS donkey(no Zlib)"
-    fi
+    AC_CHECK_FILE(../src/networks/donkey,DONKEY=yes, [
+      DONKEY=no
+      BAD_TARGETS="$BAD_TARGETS donkey"
+    ])
   else
     DONKEY=no
     BAD_TARGETS="$BAD_TARGETS donkey"
@@ -736,30 +754,20 @@
 #  fi
 
   if test "$GNUTELLA" = "yes"; then
-    if test "$ZLIB" = "yes"; then
        AC_CHECK_FILE(../src/networks/gnutella,GNUTELLA=yes, [
          GNUTELLA=no
          BAD_TARGETS="$BAD_TARGETS gnutella"
        ])
-    else
-       GNUTELLA=no
-       BAD_TARGETS="$BAD_TARGETS gnutella(no Zlib)"
-    fi
   else
     GNUTELLA=no
     BAD_TARGETS="$BAD_TARGETS gnutella"
   fi
 
   if test "$GNUTELLA2" = "yes"; then
-    if test "$ZLIB" = "yes"; then
        AC_CHECK_FILE(../src/networks/gnutella2,GNUTELLA2=yes, [
          GNUTELLA2=no
          BAD_TARGETS="$BAD_TARGETS gnutella2"
        ])
-    else
-       GNUTELLA2=no
-       BAD_TARGETS="$BAD_TARGETS gnutella2(no Zlib)"
-    fi
   else
     GNUTELLA2=no
     BAD_TARGETS="$BAD_TARGETS gnutella2"
@@ -784,15 +792,10 @@
   fi
 
   if test "$SOULSEEK" = "yes"; then
-    if test "$ZLIB" = "yes"; then
        AC_CHECK_FILE(../src/networks/soulseek,SOULSEEK=yes, [
          SOULSEEK=no
          BAD_TARGETS="$BAD_TARGETS soulseek"
        ])
-    else
-       SOULSEEK=no
-       BAD_TARGETS="$BAD_TARGETS soulseek(no Zlib)"
-    fi
   else
     SOULSEEK=no
     BAD_TARGETS="$BAD_TARGETS soulseek"
@@ -816,12 +819,6 @@
     BAD_TARGETS="$BAD_TARGETS FastTrack(devel)"
   fi
 
-  if test "$BROOSNET" = "yes" ; then
-    AC_CHECK_FILE(../src/networks/bittorrent/bTBroosnet.ml,BROOSNET=yes, [
-      BROOSNET=no
-    ])
-  fi
-
 if test "$DONKEY" = "yes" ; then
 
   AC_CHECK_FILE(../src/networks/donkey,[
@@ -847,9 +844,6 @@
   echo "Checking the libraries required to build the GTK GUI."
   echo "---------------------------------------------------------"
   if test "$GUI" = "newgui2"; then
-    AC_MSG_CHECKING(for Zlib)
-    if test "$ZLIB" = "yes"; then
-      AC_MSG_RESULT(yes)
       REQUIRED_GTK=2.4.0
       PKG_GTK=gtk+-2.0
       AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
@@ -871,10 +865,6 @@
         GTK_CONFIG=no
         AC_MSG_RESULT(no)
       fi
-    else
-      GTK_CONFIG=no
-      AC_MSG_RESULT(no)
-    fi
   else
     if test "$OS_FILES2" = "mingw"; then
       REQUIRED_GTK=1.3.0
@@ -1007,40 +997,6 @@
    IM=no
 fi
 
-
-if test "$IM" = "yes"; then
-  CRYPTOKIT=no
-  AC_MSG_CHECKING(for CryptoKit)
-  if test -f $OCAMLLIB/cryptokit.$OCAMLLIB_EXT; then
-    CRYPTOKIT=yes
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-  fi
-
-  if test "$CRYPTOKIT" = "yes"; then
-    YAXPO=no
-    AC_MSG_CHECKING(Checking for Yaxpo)
-    if test -f $OCAMLLIB/yaxpo.$OCAMLLIB_EXT; then
-      YAXPO=yes
-      AC_MSG_RESULT(yes)
-    else
-      AC_MSG_RESULT(no)
-    fi
-  fi
-
-  if test "$YAXPO" = "yes"; then
-    JABBR=no
-    AC_MSG_CHECKING(Checking for Jabbr)
-    if test -f $OCAMLLIB/jabbr.$OCAMLLIB_EXT; then
-      JABBR=yes
-      AC_MSG_RESULT(yes)
-    else
-      AC_MSG_RESULT(no)
-    fi
-  fi
-fi
-
 if test "$USE_PTHREAD" = "no"; then
  PTHREAD_LIBS=""
  echo "Dont use threads"
@@ -1125,7 +1081,7 @@
   LIBS=$SAVE_LIBS
 
   if test "$LIBGD" = "no"; then
-    AC_MSG_NOTICE(not found, trying another method)
+    AC_MSG_NOTICE([not found, trying another method])
     AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
   fi
 
@@ -1147,7 +1103,7 @@
       LIBS=$SAVE_LIBS
 
       if test "$LIBGD_PNG" = "no"; then
-        AC_MSG_NOTICE(not found, trying another method)
+        AC_MSG_NOTICE([not found, trying another method])
         AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
       fi
 
@@ -1180,7 +1136,7 @@
       LIBS=$SAVE_LIBS
 
       if test "$LIBGD_JPG" = "no"; then
-        AC_MSG_NOTICE(not found, trying another method)
+        AC_MSG_NOTICE([not found, trying another method])
         AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
       fi
 
@@ -1237,21 +1193,13 @@
 
 TMK=no
 
-AC_CHECK_FILE(../src/pic/picMain.ml,EXTRA_DIRS="$EXTRA_DIRS src/pic", )
-AC_CHECK_FILE(../src/spider/ecrawler/spiderMain.ml,EXTRA_DIRS="$EXTRA_DIRS src/spider/ecrawler src/spider/analyser1", )
-AC_CHECK_FILE(../src/spider/disasm/mldisasm.ml,EXTRA_DIRS="$EXTRA_DIRS src/spider/disasm src/spider/tmk", )
-AC_CHECK_FILE(../src/spider/tmk/tmkSimple.ml,TMK=yes, )
-AC_CHECK_FILE(../src/btview/btviewMain.ml,EXTRA_DIRS="$EXTRA_DIRS src/btview", )
-AC_CHECK_FILE(../src/cluster/clusterMain.ml,EXTRA_DIRS="$EXTRA_DIRS src/cluster", )
-
-AC_CHECK_FILE(../src/networks/fasttrack/fasttrackSupernode.ml,SUPERNODES="yes", )
-
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(CC)
 AC_SUBST(CPP)
+AC_SUBST(CXX)
 AC_SUBST(CONFIG_INCLUDES)
 
 AC_SUBST(EXTRA_DIRS)
@@ -1275,7 +1223,6 @@
 AC_SUBST(LABLGL_CMXA)
 AC_SUBST(MD4ARCH)
 AC_SUBST(MD4COMP)
-AC_SUBST(ZLIB)
 AC_SUBST(BZIP2)
 AC_SUBST(GD)
 AC_SUBST(GD_JPG)
@@ -1294,11 +1241,6 @@
 AC_SUBST(DONKEY)
 AC_SUBST(OPEN_DONKEY)
 AC_SUBST(DONKEY_SERVER)
-AC_SUBST(BROOSNET)
-
-AC_SUBST(JABBR)
-
-AC_SUBST(SUPERNODES)
 
 AC_SUBST(GUI)
 AC_SUBST(REQUIRED_OCAML)
@@ -1326,10 +1268,6 @@
 AC_SUBST(HAS_GD)
 AC_SUBST(HAS_GD_PNG)
 AC_SUBST(HAS_GD_JPG)
-AC_SUBST(HAS_ZLIB)
-AC_SUBST(ZLIB__UNCOMPRESS_STRING2)
-AC_SUBST(ZLIB__COMPRESS_STRING)
-AC_SUBST(ZLIB__GZIP_STRING)
 AC_SUBST(HAS_BZIP2)
 
 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./config/Makefile.config.in ./config/Makefile.config.in
--- ./config/Makefile.config.in	2005-07-23 16:19:48.000000000 +0200
+++ ./config/Makefile.config.in	2005-09-22 17:02:29.000000000 +0200
@@ -4,6 +4,7 @@
 LDFLAGS=@LDFLAGS@
 CC=@CC@
 CPP=@CPP@
+CXX=@CXX@
 CONFIG_INCLUDES=@CONFIG_INCLUDES@
 
 OCAMLC=@OCAMLC@
@@ -36,7 +37,6 @@
 OPENFT=@OPENFT@
 FASTTRACK=@FASTTRACK@
 FILETP=@FILETP@
-BROOSNET=@BROOSNET@
 
 GUI=@GUI@
 
@@ -45,7 +45,6 @@
 REQUIRED_LABLGTK=@REQUIRED_LABLGTK@
 
 ICONV=@ICONV@
-ZLIB=@ZLIB@
 BZIP2=@BZIP2@
 GD=@GD@
 GD_JPG=@GD_JPG@
@@ -61,8 +60,6 @@
 
 CURRENT_VERSION=@MLDONKEY_VERSION@
 
-JABBR=@JABBR@
-
 OS_FILES=@OS_FILES@
 OS_FILES2=@OS_FILES2@
 
@@ -80,5 +77,3 @@
 GTKLLIBS=@GTKLLIBS@
 GTKLFLAGS=@GTKLFLAGS@
 TMK=@TMK@
-
-SUPERNODES=@SUPERNODES@
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./config/Makefile.in ./config/Makefile.in
--- ./config/Makefile.in	2005-09-21 20:08:55.000000000 +0200
+++ ./config/Makefile.in	2005-09-22 17:02:29.000000000 +0200
@@ -146,10 +146,8 @@
   CDK_SRCS +=  $(CDK)/bzlib.ml $(CDK)/bzip2.ml
 endif
 
-ifeq ("$(ZLIB)", "yes")
-  LIBS_flags += -cclib -lz
-  CDK_SRCS +=  $(CDK)/zlib.ml $(CDK)/zip.ml $(CDK)/gzip.ml $(CDK)/zlibstubs.c $(CDK)/tar.ml
-endif
+LIBS_flags += -cclib -lz
+CDK_SRCS +=  $(CDK)/zlib.ml $(CDK)/zip.ml $(CDK)/gzip.ml $(CDK)/zlibstubs.c $(CDK)/tar.ml
 
 ifeq ("$(GD)", "yes")
   LIBS_flags += -cclib -lgd -cclib -lfreetype -cclib -lm
@@ -164,24 +162,11 @@
   CDK_SRCS +=  $(CDK)/gd.ml $(CDK)/gdstubs.c
 endif
 
-ifeq ("$(SUPERNODES)", "yes")
-  FASTTRACK_SUPERNODE=$(SRC_FASTTRACK)/fasttrackSupernode.ml
-else
-
-endif
-
-ifeq ("$(BROOSNET)", "yes")
-  BROOSNET = \
-       $(SRC_BITTORRENT)/bTBrooseTypes.ml \
-       $(SRC_BITTORRENT)/bTProtoBroosnet.ml \
-       $(SRC_BITTORRENT)/bTBroosnet.ml
-endif
-
 CDK_SRCS += $(LIB)/autoconf.ml
 
 
 CDK_SRCS+= $(LIB)/fifo.ml $(CDK)/arg2.ml $(CDK)/printf2.ml \
-   $(CDK)/heap.ml $(CDK)/dprintf.ml \
+  $(CDK)/heap.ml $(CDK)/dprintf.ml \
   $(CDK)/printexc2.ml $(CDK)/genlex2.ml $(CDK)/sysenv.ml \
   $(CDK)/netbase.ml $(CDK)/filepath.ml $(CDK)/string2.ml \
   $(CDK)/filename2.ml $(CDK)/list2.ml $(CDK)/hashtbl2.ml \
@@ -452,7 +437,6 @@
   $(SRC_FASTTRACK)/fasttrackClients.mlt \
   $(SRC_FASTTRACK)/fasttrackHandler.ml \
   $(SRC_FASTTRACK)/fasttrackServers.ml \
-  $(FASTTRACK_SUPERNODE) \
   $(SRC_FASTTRACK)/fasttrackPandora.ml \
   $(SRC_FASTTRACK)/fasttrackInteractive.mlt \
   $(SRC_FASTTRACK)/fasttrackMain.mlt
@@ -472,7 +456,6 @@
   $(SRC_BITTORRENT)/bTShare.ml \
   $(SRC_BITTORRENT)/bTClients.ml \
   $(SRC_BITTORRENT)/bTInteractive.ml \
-  $(BROOSNET) \
   $(SRC_BITTORRENT)/bTMain.ml
   
 OPENFT_SRCS= \
@@ -1684,7 +1667,7 @@
 	rm -rf patches/build
 	rm -f config/Makefile.config
 	rm -f config/mldonkey.rc
-	rm -f config/config.cache config/config.log config/config.status config/trying
+	rm -f config/config.cache config/config.log config/config.status
 	rm -f config/config.h
 	rm -f config/confdefs.h
 	rm -rf config/autom4te.cache/
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/common/commonComplexOptions.ml ./src/daemon/common/commonComplexOptions.ml
--- ./src/daemon/common/commonComplexOptions.ml	2005-09-17 17:23:08.000000000 +0200
+++ ./src/daemon/common/commonComplexOptions.ml	2005-09-22 17:02:29.000000000 +0200
@@ -1019,8 +1019,7 @@
 	  let error = (Printexc2.to_string e) in
 	    if error =
 	      "Gzip.Error(\"error during compression\")"
-	      && Autoconf.system = "windows"
-	      && arg = "fasttrack.ini" then
+	      && Autoconf.windows && arg = "fasttrack.ini" then
               (* for whatever reason this error is raised on Windows,
                  but fasttrack.ini is stored correctly *)
 	      if !verbose_hidden_errors then
@@ -1092,16 +1091,12 @@
 	       if real_glibc_version <> Autoconf.glibc_version
 	         && real_glibc_version <> "" then
 		   Printf.sprintf " (DANGER: glibc %s present on system)" real_glibc_version else "")
-      ^ (if Autoconf.configure_arguments <> "" then "\nConfigure arguments: " ^ Autoconf.configure_arguments else "")
+      ^ (if Autoconf.configure_arguments <> "" then
+           "\nConfigure arguments: " ^ Autoconf.configure_arguments else "")
       ^ (if !patches_string <> "" then "\n" ^ !patches_string else "")
       ^ "\nFeatures:"
           ^ (if BasicSocket.has_threads () then " threads" else " no-threads")
-          ^ (if Autoconf.has_zlib then
-	       begin
-	         let s = Zlib.zlib_version_num () in
-	           Printf.sprintf " zlib%s" (if s <> "" then "-" ^ s else "")
-	       end
-	     else " no-zlib")
+          ^ (let s = Zlib.zlib_version_num () in Printf.sprintf " zlib%s" (if s <> "" then "-" ^ s else ""))
           ^ (if Autoconf.has_bzip2 then
 	       begin
 	         let s =
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/common/commonInteractive.ml ./src/daemon/common/commonInteractive.ml
--- ./src/daemon/common/commonInteractive.ml	2005-09-06 13:29:10.000000000 +0200
+++ ./src/daemon/common/commonInteractive.ml	2005-09-22 17:02:29.000000000 +0200
@@ -53,7 +53,7 @@
   | 60  (* '<'  *)
   | 62  (* '>'  *)
   | 124 (* '|'  *)
-  | 37  (* '%'  *) when Autoconf.system = "windows" -> 95 (* '_' *)
+  | 37  (* '%'  *) when Autoconf.windows -> 95 (* '_' *)
   | _ -> uc
 
 let canonize_basename name =
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/common/commonOptions.ml ./src/daemon/common/commonOptions.ml
--- ./src/daemon/common/commonOptions.ml	2005-09-21 00:43:04.000000000 +0200
+++ ./src/daemon/common/commonOptions.ml	2005-09-22 17:02:29.000000000 +0200
@@ -29,13 +29,14 @@
 let bin_dir = Filename.dirname Sys.argv.(0)
 
 let hidden_dir_prefix =
-  if Autoconf.system = "windows" then "" else "."
+  if Autoconf.windows then "" else "."
 
 let config_dir_basename = hidden_dir_prefix ^ "mldonkey"
 
 let home_dir =
   match Autoconf.system with
-  | "windows" -> "."
+  | "cygwin"
+  | "mingw" -> "."
   | _ -> Filename.concat (try Sys.getenv "HOME" with _ -> ".") config_dir_basename
 
 let installer_ini = create_options_file (Filename.concat home_dir
@@ -85,7 +86,7 @@
   if Sys.file_exists (Filename.concat (Sys.getcwd ()) "downloads.ini") then
     "."
   else
-    if Autoconf.system = "windows" && file_basedir_pre <> home_dir then
+    if Autoconf.windows && file_basedir_pre <> home_dir then
       match String2.split file_basedir_pre ':' with
       | drive :: directory :: _ ->
           Unix.chdir (drive ^ ":\\");
@@ -1469,7 +1470,7 @@
 	    end;
           let oc = open_out_gen [Open_creat; Open_wronly; Open_append] 0o644 !!log_file in
           lprintf_to_file := true;
-          if Autoconf.system = "windows" then lprintf "%s" win_message;
+          if Autoconf.system = "cygwin" then lprintf "%s" win_message;
           lprintf_nl "Logging in %s" ( Filename.concat file_basedir !!log_file);
           log_to_file oc;
 	  lprintf_nl "Started logging..."
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/driver/driverControlers.ml ./src/daemon/driver/driverControlers.ml
--- ./src/daemon/driver/driverControlers.ml	2005-09-21 20:10:06.000000000 +0200
+++ ./src/daemon/driver/driverControlers.ml	2005-09-22 17:02:29.000000000 +0200
@@ -802,7 +802,7 @@
   add_reply_header r "Connection" "close"
 
 let add_gzip_headers r =
-  if Autoconf.has_zlib && !!html_use_gzip then begin
+  if !!html_use_gzip then begin
     add_reply_header r "Content-Encoding" "gzip";
     add_reply_header r "Vary" "Accept-Encoding";
   end
@@ -1432,7 +1432,7 @@
     | BIN -> Buffer.contents buf
     | UNK -> "Unknown type for content :" ^ (Buffer.contents buf)
   in
-  r.reply_content <- if Autoconf.has_zlib && !!html_use_gzip then Autoconf.zlib__gzip_string s else s
+  r.reply_content <- if !!html_use_gzip then Autoconf.zlib__gzip_string s else s
 
 let http_options = {
     conn_buf = Buffer.create 10000;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/driver/driverMain.ml ./src/daemon/driver/driverMain.ml
--- ./src/daemon/driver/driverMain.ml	2005-09-21 00:43:04.000000000 +0200
+++ ./src/daemon/driver/driverMain.ml	2005-09-22 17:02:29.000000000 +0200
@@ -487,7 +487,7 @@
 	(if !!gui_bind_addr = Ip.any then "127.0.0.1"
 		else Ip.to_string !!gui_bind_addr)  !!gui_port;
   lprintf_nl (_b "If you connect from a remote machine adjust allowed_ips");
-  if Autoconf.system = "windows" && not !keep_console_output then lprintf (_b "%s") win_message;
+  if Autoconf.system = "cygwin" && not !keep_console_output then lprintf (_b "%s") win_message;
 
   add_init_hook (fun _ ->
       if not !gui_included && ( !!start_gui || !!ask_for_gui ) then
@@ -531,11 +531,11 @@
   DriverInteractive.initialization_completed := true;
   DriverInteractive.save_config ();
 
-  if Autoconf.system <> "windows" then
+  if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigchld
       (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGCHLD, doing nothing"));
 
-  if Autoconf.system <> "windows" then
+  if not Autoconf.windows then
     MlUnix.set_signal  Sys.sighup
       (Sys.Signal_handle (fun _ ->
 	 lprintf_nl "Received SIGHUP, closing all files/sockets";
@@ -543,7 +543,7 @@
 	 Unix32.close_all ()
          ));
 
-  if Autoconf.system <> "windows" then
+  if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigpipe
       (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received SIGPIPE, doing nothing"));
 
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/gtk/gui/gui_installer.ml ./src/gtk/gui/gui_installer.ml
--- ./src/gtk/gui/gui_installer.ml	2005-03-02 20:28:14.000000000 +0100
+++ ./src/gtk/gui/gui_installer.ml	2005-09-22 17:02:29.000000000 +0200
@@ -39,7 +39,7 @@
 let home_dir = (try Sys.getenv "HOME" with _ -> ".")
   
 let config_dir_basename =
-  if Autoconf.system = "windows" then "mldonkey" else ".mldonkey"
+  if Autoconf.windows then "mldonkey" else ".mldonkey"
   
 let config_dir = Filename.concat home_dir config_dir_basename
   
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/gtk/newgui/gui_options.ml ./src/gtk/newgui/gui_options.ml
--- ./src/gtk/newgui/gui_options.ml	2005-08-05 02:56:13.000000000 +0200
+++ ./src/gtk/newgui/gui_options.ml	2005-09-22 17:02:29.000000000 +0200
@@ -234,22 +234,22 @@
 
 let font_list =  define_option mldonkey_gui_section ["fonts"; "list"]
     ( M.h_font_list) string_option
-     ( if Autoconf.system = "windows" then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
+     ( if Autoconf.windows then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
      else "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" )
 
 let font_main_tab =  define_option mldonkey_gui_section ["fonts"; "main_tab"]
     ( M.h_font_main_tab) string_option
-     ( if Autoconf.system = "windows" then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
+     ( if Autoconf.windows then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
      else "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" )
 
 let font_networks =  define_option mldonkey_gui_section ["fonts"; "networks"]
     ( M.h_font_networks) string_option
-     ( if Autoconf.system = "windows" then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
+     ( if Autoconf.windows then "-unknown-Tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1"
      else "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" )
 
 let font_graphic =  define_option mldonkey_gui_section ["fonts"; "graphic"]
     ( M.h_font_graphic)  string_option
-     ( if Autoconf.system = "windows" then "-unknown-Tahoma-normal-r-normal-*-*-80-*-*-p-*-iso8859-1"
+     ( if Autoconf.windows then "-unknown-Tahoma-normal-r-normal-*-*-80-*-*-p-*-iso8859-1"
      else "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" )
 
 (*
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/gtk/newgui/gui_starter.ml ./src/gtk/newgui/gui_starter.ml
--- ./src/gtk/newgui/gui_starter.ml	2005-03-02 20:28:14.000000000 +0100
+++ ./src/gtk/newgui/gui_starter.ml	2005-09-22 17:02:29.000000000 +0200
@@ -7,7 +7,7 @@
 
 let home_dir = (try Sys.getenv "HOME" with _ -> ".")
 let config_dir_basename =
-  if Autoconf.system = "windows" then "mldonkey" else ".mldonkey"
+  if Autoconf.windows then "mldonkey" else ".mldonkey"
 let config_dir = Filename.concat home_dir config_dir_basename
   
 let _ = 
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyClient.ml ./src/networks/donkey/donkeyClient.ml
--- ./src/networks/donkey/donkeyClient.ml	2005-09-21 20:11:54.000000000 +0200
+++ ./src/networks/donkey/donkeyClient.ml	2005-09-22 17:02:29.000000000 +0200
@@ -1569,15 +1569,12 @@
           in
           let pos = iter comp.comp_blocs in
           assert (pos = comp.comp_len);
-          if Autoconf.has_zlib then
             let s = Autoconf.zlib__uncompress_string2 s in
             if !verbose then
 	      lprintf_nl () "Decompressed: %d/%d" (String.length s) comp.comp_len;
             
             DonkeyOneFile.block_received c comp.comp_md4
-              comp.comp_pos s 0 (String.length s)
-          else
-            lprintf_nl () "ERROR: No Zlib to uncompress packet";
+              comp.comp_pos s 0 (String.length s);
           
           c.client_comp <- None;
         end else
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyMain.ml ./src/networks/donkey/donkeyMain.ml
--- ./src/networks/donkey/donkeyMain.ml	2005-09-18 21:00:52.000000000 +0200
+++ ./src/networks/donkey/donkeyMain.ml	2005-09-22 17:02:29.000000000 +0200
@@ -140,7 +140,6 @@
     int_tag (Field_UNKNOWN "port") !!donkey_port;
   ];
   let extended = ref 0x04 in (* support of auxport *)
-  if Autoconf.has_zlib then
     extended := !extended lor 0x01; (* support of compression *)
     client_to_server_tags := (int_tag
       (Field_UNKNOWN "extended") !extended)::!client_to_server_tags;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyPandora.ml ./src/networks/donkey/donkeyPandora.ml
--- ./src/networks/donkey/donkeyPandora.ml	2004-11-01 12:23:01.000000000 +0100
+++ ./src/networks/donkey/donkeyPandora.ml	2005-09-22 17:02:29.000000000 +0200
@@ -186,11 +186,8 @@
                 in
                 let pos = iter comp.comp_blocs in
                 assert (pos = comp.comp_len);
-                if Autoconf.has_zlib then
                   let s = Autoconf.zlib__uncompress_string2 s in
                   lprintf "Decompressed: %d/%d\n" (String.length s) comp.comp_len;
-                else
-                  lprintf "No Zlib to uncompress packet";
                   
                 c.client_comp <- None;
               end else
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyProtoClient.ml ./src/networks/donkey/donkeyProtoClient.ml
--- ./src/networks/donkey/donkeyProtoClient.ml	2005-09-18 21:00:52.000000000 +0200
+++ ./src/networks/donkey/donkeyProtoClient.ml	2005-09-22 17:02:29.000000000 +0200
@@ -24,10 +24,10 @@
 open CommonTypes
 open LittleEndian
 open CommonGlobals
-  
+
 open DonkeyTypes
 open DonkeyMftp
-  
+
 let emule_version b1 b2 b3 b4 b5 =
   let s = Printf.sprintf "%s"
     (string_of_int(int_of_string("0b" ^
@@ -50,16 +50,16 @@
     emule_secident = 3; (* Emule uses v1 if advertising both, v2 if only advertising 2 *)
     emule_noviewshared = 0;
     emule_supportpreview = 0;
-    emule_compression = if Autoconf.has_zlib then 1 else 0; (* 1 *)
+    emule_compression = 1; (* 1 *)
     emule_sourceexchange = 2; (* 2 : +client_md4 3 : +IdHybrid (emule Kademlia?)*)
     emule_multipacket = 0; (* 1 *)
     emule_extendedrequest = 1; (* 1: +file_status 2: +ncomplete_sources*)
     emule_features = 0; (* 3 *)
     emule_udpver = 0; (* 4 *)
   }
-  
-let emule_miscoptions1 m = 
-  let o = 
+
+let emule_miscoptions1 m =
+  let o =
     (m.emule_udpver lsl 24) lor
     (m.emule_compression lsl 20) lor
     (m.emule_secident lsl 16) lor
@@ -71,7 +71,7 @@
     (m.emule_supportpreview lsl 0)
   in
   Int64.of_int o
-  
+
 let update_emule_proto_from_miscoptions1 m o =
   let o = Int64.to_int o in
   m.emule_udpver <- (o lsr 24) land 0xf;
@@ -83,11 +83,11 @@
   m.emule_noviewshared <- (o lsr 2) land 0x1;
   m.emule_udpver <- (o lsr 1) land 0x1;
   m.emule_udpver <- (o lsr 0) land 0x1
-  
-let extendedrequest e = 
+
+let extendedrequest e =
   min e.emule_extendedrequest mldonkey_emule_proto.emule_extendedrequest
-  
-let sourceexchange e = 
+
+let sourceexchange e =
   min e.emule_sourceexchange mldonkey_emule_proto.emule_sourceexchange
 
 (*
@@ -103,11 +103,8 @@
 (0)(0)(0)(0)
 (0)(0)(0)(0)(0)(0)
 ]
-
-
-
   *)
-  
+
 module Connect  = struct
     type t = {
         md4 : Md4.t;
@@ -118,7 +115,7 @@
         server_info : (Ip.t * int) option;
         left_bytes: string;
       }
-    
+
     let names_of_tag =
       [
         "\001", Field_UNKNOWN "name";
@@ -132,7 +129,7 @@
         "\250", Field_UNKNOWN "emule_miscoptions1";
         "\251", Field_UNKNOWN "emule_version";
       ]
-      
+
     let parse len s =
       let version = get_uint8 s 1 in
       let md4 = get_md4 s 2 in
@@ -141,8 +138,8 @@
 (*      lprintf "port: %d" port; lprint_newline (); *)
       let tags, pos = get_tags s 24 names_of_tag in
       let len = String.length s in
-      let server_info = 
-        Some (get_ip s pos, get_port s (pos+4)) 
+      let server_info =
+        Some (get_ip s pos, get_port s (pos+4))
       in
       let left_bytes = String.sub s (pos+6) (String.length s - pos - 6) in
       {
@@ -154,8 +151,8 @@
         server_info = server_info;
         left_bytes = left_bytes;
       }
-    
-    let print t = 
+
+    let print t =
       lprintf "Connect (version %d) from [%s:%d] MD4: %s"
         t.version
         (Ip.to_string t.ip)
@@ -180,7 +177,7 @@
       buf_tags buf t.tags names_of_tag;
       begin
         match t.server_info with
-          None -> 
+          None ->
             buf_ip buf Ip.null;
             buf_port buf 0
         | Some (ip, port) ->
@@ -194,7 +191,7 @@
 module ConnectReply  = struct
     open Connect
     type t = Connect.t
-      
+
     let parse len s =
       let version = get_uint8 s 1 in
       let md4 = get_md4 s 2 in
@@ -202,8 +199,8 @@
       let port = get_port s 22 in
       let tags, pos = get_tags s 24 names_of_tag in
       let len = String.length s in
-      let server_info = 
-        Some (get_ip s pos, get_port s (pos+4)) 
+      let server_info =
+        Some (get_ip s pos, get_port s (pos+4))
       in
       let left_bytes = String.sub s (pos+6) (String.length s - pos - 6) in
       {
@@ -215,7 +212,7 @@
         server_info = server_info;
         left_bytes = left_bytes;
       }
-    
+
     let parse len s =
       let md4 = get_md4 s 1 in
       let ip = get_ip s 17 in
@@ -232,8 +229,8 @@
         left_bytes = left_bytes;
         version = -1;
       }
-    
-    let print t = 
+
+    let print t =
       lprintf "Connect reply from [%s:%d] MD4: %s"
         (Ip.to_string t.ip)
 	t.port
@@ -248,7 +245,7 @@
         lprintf "  left bytes = ";
         String.iter (fun c -> lprintf "(%d)" (int_of_char c))
         t.left_bytes  end
-      
+
     let write buf t =
       buf_md4 buf t.md4;
       buf_ip buf t.ip;
@@ -266,46 +263,46 @@
 
 module Say = struct
     type t = string
-      
+
     let parse len s =
       let (s, p) = get_string s 1 in
       s
-      
+
     let print t =
       lprintf "SAY %s" t
-      
+
     let write buf t =
       buf_string buf t
   end
-  
-module OneMd4 = functor(M: sig val m : string end) -> (struct 
+
+module OneMd4 = functor(M: sig val m : string end) -> (struct
     type t = Md4.t
-      
-    let parse len s = 
+
+    let parse len s =
       get_md4 s 1
-      
-    let print t = 
+
+    let print t =
           lprintf "%s OF %s" M.m (Md4.to_string t)
-          
-    let write buf t = 
+
+    let write buf t =
       buf_md4 buf t
       end)
-  
+
 module JoinQueue = struct
     type t = Md4.t option
-      
-    let parse len s = 
+
+    let parse len s =
       if len >= 17 then
         Some (get_md4 s 1)
       else None
-      
-    let print t = 
+
+    let print t =
       lprintf "JOIN QUEUE";
       (match t with None -> () | Some md4 ->
             lprintf " OF %s" (Md4.to_string md4));
       lprint_newline ()
-          
-    let write emule buf t = 
+
+    let write emule buf t =
       if extendedrequest emule > 0 then
         match t with
           None -> ()
@@ -318,17 +315,17 @@
           val parse : int -> string  -> t
           val print : t -> unit
           val write : Buffer.t -> t  -> unit
-          val t :t 
+          val t :t
           end
       )
 *)
-    
+
 (* In Emule, this message contains much more information, and will probably
 remove the need for QueryChunks. *)
 
 let get_bitmap s pos =
   let nchunks = get_int16 s pos in
-  let chunks, pos = 
+  let chunks, pos =
     if nchunks = 0 then [||], pos+2 else
     let pos = pos + 2 in
     let chunks = Array.create nchunks false  in
@@ -347,13 +344,13 @@
 
 let print_bitmap chunks =
   lprint_string "\n   ";
-  Array.iter (fun b -> 
+  Array.iter (fun b ->
       if b then lprintf "1" else lprintf "0") chunks
 
 let write_bitmap buf chunks =
   let nchunks = Array.length chunks in
   buf_int16 buf nchunks;
-  if nchunks > 0 then 
+  if nchunks > 0 then
   for i = 0 to (nchunks-1) / 8 do
     let m = ref 0 in
     for j = 0 to 7 do
@@ -364,43 +361,42 @@
     done;
     buf_int8 buf !m
   done
-  
+
 module QueryFile  = struct
     type t = {
         md4 : Md4.t;
         emule_extension : (bool array * int) option;
       }
-    
-    let parse emule len s = 
-(*      Printf.printf "Query File: emule version %d len %d" 
+
+    let parse emule len s =
+(*      Printf.printf "Query File: emule version %d len %d"
       (extendedrequest emule) len;
       print_newline (); *)
       let md4 = get_md4 s 1 in
-      let emule_extension = 
+      let emule_extension =
         try
           if len < 18 || extendedrequest emule = 0 then None else
           let chunks, pos = get_bitmap s 17 in
-          let ncompletesources = 
+          let ncompletesources =
             if extendedrequest emule > 1 && len > pos+1 then get_int16 s pos
             else -1 in
           Some (chunks, ncompletesources)
         with _ -> None
       in
-      { md4 = md4; 
+      { md4 = md4;
         emule_extension = emule_extension }
-    
-    
-    let print t = 
+
+    let print t =
       lprintf "QUERY FILE OF %s" (Md4.to_string t.md4);
       match t.emule_extension with
         None -> ()
       | Some (bitmap, ncompletesources) ->
-          print_bitmap bitmap; 
+          print_bitmap bitmap;
           lprint_newline ();
           if ncompletesources >= 0 then
             lprintf_nl "Complete sources: %d" ncompletesources
-    
-    let write emule buf t = 
+
+    let write emule buf t =
       buf_md4 buf t.md4;
       match t.emule_extension with
         None -> ()
@@ -410,68 +406,62 @@
               if extendedrequest emule > 1 && ncompletesources >= 0 then
                 buf_int16 buf ncompletesources
             end
-            
   end
-  
-  
+
 module QueryChunks  = OneMd4(struct let m = "QUERY CHUNKS" end)
   (* Request 79 *)
-    
+
 module QueryChunkMd4  = OneMd4(struct let m = "QUERY CHUNKS MD4" end)
 module EndOfDownload  = OneMd4(struct let m = "END OF DOWNLOAD MD4" end)
 module NoSuchFile  = OneMd4(struct let m = "NO SUCH FILE" end)
 
 module QueryChunksReply = struct (* Request 80 *)
-    
+
     type t = {
         md4 : Md4.t;
         chunks: bool array;
       }
-    
-    let parse len s = 
+
+    let parse len s =
       let md4 = get_md4 s 1 in
       let chunks, pos = get_bitmap s 17 in
       {
         md4 = md4;
         chunks = chunks;
       }
-      
+
     let print t =
       lprintf_nl "CHUNKS for %s" (Md4.to_string t.md4);
       lprint_string "   ";
-      Array.iter (fun b -> 
+      Array.iter (fun b ->
           if b then lprintf "1" else lprintf "0") t.chunks;
       lprint_newline ()
-    
+
     let write buf t =
       buf_md4 buf t.md4;
       write_bitmap buf t.chunks;
       if t.chunks = [||] then buf_int8 buf 0
-                
   end
 (*
 dec: [(96)(215)(1)(0)(0)(0)(0)(0)(0)(0)(0)(0)(0)]
 
 OP_QUEUERANKING: int16
-  
-  
 *)
 
-
 module QueryChunkMd4Reply = struct (* Request 80 *)
-    
+
     type t = {
         md4 : Md4.t;
         chunks: Md4.t array;
       }
-      
-    let parse len s = 
+
+    let parse len s =
       let md4 = get_md4 s 1 in
       let nchunks = get_int16 s 17 in
 (*      lprintf "nchunks : %d" nchunks; lprint_newline (); *)
       let chunks = Array.create nchunks md4  in
       for i = 0 to nchunks - 1 do
-        chunks.(i) <- get_md4 s (19 + i * 16)        
+        chunks.(i) <- get_md4 s (19 + i * 16)
       done;
       {
         md4 = md4;
@@ -481,11 +471,11 @@
     let print t =
       lprintf_nl "CHUNKS for %s" (Md4.to_string t.md4);
       lprint_string "   ";
-      Array.iter (fun b -> 
+      Array.iter (fun b ->
           lprintf "  %s" (Md4.to_string b))
       t.chunks;
       lprint_newline ()
-      
+
     let write buf t =
       buf_md4 buf t.md4;
       let nchunks = Array.length t.chunks in
@@ -493,31 +483,30 @@
       for i = 0 to nchunks - 1 do
         buf_md4 buf t.chunks.(i)
       done
-      
   end
-  
-module QueryFileReply  = struct 
+
+module QueryFileReply  = struct
     type t = {
         md4 : Md4.t;
         name : string;
       }
-      
-    let parse len s = 
+
+    let parse len s =
       let name, _ = get_string s 17 in
       { md4 = get_md4 s 1;
         name =  name;
       }
-      
-    let print t = 
+
+    let print t =
       lprintf_nl "QUERY FILE REPLY OF %s" (Md4.to_string t.md4);
       lprintf_nl "  name = \"%s\"" t.name
-      
-    let write buf t = 
+
+    let write buf t =
       buf_md4 buf t.md4;
       buf_string buf t.name
   end
-    
-module Bloc  = struct 
+
+module Bloc  = struct
     type t = {
         md4 : Md4.t;
         start_pos : int64;
@@ -526,8 +515,8 @@
         bloc_begin : int;
         bloc_len : int;
       }
-      
-    let parse len s = 
+
+    let parse len s =
       {
         md4 = get_md4 s 1;
         start_pos = get_uint64_32 s 17;
@@ -536,21 +525,21 @@
         bloc_begin = 25;
         bloc_len = len - 25;
       }
-      
-    let print t = 
+
+    let print t =
       lprintf "BLOC OF %s len %Ld [%Ld - %Ld] " (Md4.to_string t.md4)
       (t.end_pos -- t.start_pos)
       t.start_pos
         t.end_pos
-      
-    let write buf t = 
+
+    let write buf t =
       buf_md4 buf t.md4;
       buf_int64_32 buf t.start_pos;
       buf_int64_32 buf t.end_pos;
       Buffer.add_substring buf t.bloc_str t.bloc_begin t.bloc_len
   end
-    
-module QueryBloc  = struct 
+
+module QueryBloc  = struct
     type t = {
         md4 : Md4.t;
         start_pos1 : int64; (* 180 ko *)
@@ -560,8 +549,8 @@
         start_pos3 : int64;
         end_pos3: int64;
       }
-      
-    let parse len s = 
+
+    let parse len s =
       {
         md4 = get_md4 s 1;
         start_pos1 = get_uint64_32 s 17;
@@ -571,15 +560,15 @@
         start_pos3 = get_uint64_32 s 25;
         end_pos3 = get_uint64_32 s 37;
       }
-      
-    let print t = 
+
+    let print t =
       lprintf "QUERY BLOCS OF %s [%s - %s] [%s - %s] [%s - %s]"
       (Md4.to_string t.md4)
       (Int64.to_string t.start_pos1) (Int64.to_string t.end_pos1)
       (Int64.to_string t.start_pos2) (Int64.to_string t.end_pos2)
       (Int64.to_string t.start_pos3) (Int64.to_string t.end_pos3)
-      
-    let write buf t = 
+
+    let write buf t =
       buf_md4 buf t.md4;
       buf_int64_32 buf t.start_pos1;
       buf_int64_32 buf t.start_pos2;
@@ -587,50 +576,47 @@
       buf_int64_32 buf t.end_pos1;
       buf_int64_32 buf t.end_pos2;
       buf_int64_32 buf t.end_pos3
-      
   end
 
-  
 let unit = ()
-module NoArg = functor(M: sig val m : string end) -> (struct 
+module NoArg = functor(M: sig val m : string end) -> (struct
         type t = unit
-        
+
         let parse len s = ()
-        
-        let print t = 
+
+        let print t =
           lprintf_nl "%s:" M.m
-        
+
         let write (buf: Buffer.t) (t: t) = unit
-          
+
         let t = (() : t)
       end : sig
         type t
           val parse : int -> string  -> t
           val print : t -> unit
           val write : Buffer.t -> t  -> unit
-          val t :t 
+          val t :t
           end
       )
-    
+
 module AvailableSlot = NoArg(struct let m = "AvailableSlot" end)
 module ReleaseSlot = NoArg(struct let m = "ReleaseSlot" end)
 module CloseSlot = NoArg(struct let m = "CloseSlot" end)
 module ViewFiles = NoArg(struct let m = "VIEW FILES" end)
 
-  
-module ViewFilesReply = struct 
-    
+module ViewFilesReply = struct
+
     type file = {
         md4: Md4.t;
         ip: Ip.t;
         port: int;
         tags:  tag list;
       }
-    
+
     type t = tagged_file list
-    
+
     let names_of_tag = file_common_tags
-    
+
     let rec get_files  s pos n =
       if n = 0 then [], pos else
       let md4 = get_md4 s pos in
@@ -645,14 +631,13 @@
         } in
       let files, pos =  get_files s pos (n-1) in
       file :: files, pos
-    
-    
+
     let parse len s =
       let n = get_int s 1 in
       let files, pos = get_files s 5 n in
       files
-    
-    let print t = 
+
+    let print t =
       lprintf_nl "VIEW FILES REPLY:";
       List.iter (fun t ->
           lprintf_nl "FILE:";
@@ -662,7 +647,7 @@
           lprintf "  tags: ";
           print_tags t.f_tags;
           lprint_newline ();) t
-    
+
     let rec write_files buf files =
       match files with
         [] -> ()
@@ -672,11 +657,11 @@
           buf_port buf file.f_port;
           buf_tags buf file.f_tags names_of_tag;
           write_files buf files
-    
-    let write buf t = 
+
+    let write buf t =
       buf_int buf (List.length t);
       write_files buf t
-        
+
     let rec write_files_max buf files nfiles max_len =
       let prev_len = Buffer.length buf in
       match files with
@@ -690,53 +675,52 @@
             write_files_max buf files (nfiles+1) max_len
           else
             nfiles, prev_len
-
   end
-  
-module OtherLocations = struct 
+
+module OtherLocations = struct
 
     type t = Ip.t list
-      
+
     let parse len s =
       let list = ref [] in
       for i = 0 to len / 4 - 1 do
         list := (get_ip s (i*4+1)) :: !list;
       done;
       !list
-    
-    let print t = 
+
+    let print t =
       lprintf_nl "OTHER LOCATIONS:\n";
       List.iter (fun ip ->
           lprintf_nl "  ip: %s" (Ip.to_string ip);) t
-        
-    let write buf t = 
+
+    let write buf t =
       List.iter (buf_ip buf) t
   end
-  
-module NewUserID = struct 
+
+module NewUserID = struct
 
     type t = Ip.t * Ip.t
-      
+
     let parse len s =
       get_ip s 1, get_ip s 5
-    
-    let print (ip1,ip2) = 
+
+    let print (ip1,ip2) =
       lprintf_nl "NEW USER ID: %s -> %s" (Ip.to_string ip1)
       (Ip.to_string ip2)
-        
-    let write buf (ip1,ip2) = 
+
+    let write buf (ip1,ip2) =
       buf_ip buf ip1;
       buf_ip buf ip2
   end
 
 
-module Sources = struct 
+module Sources = struct
 
     type t = {
         md4: Md4.t;
         sources : (Ip.t * int * Ip.t) list;
       }
-      
+
     let parse len s =
       let len = get_int16 s 1 in
       let md4 = get_md4 s 3 in
@@ -749,31 +733,29 @@
       { md4 = md4;
         sources = !list;
       }
-    
-    let print t = 
+
+    let print t =
       lprintf_nl "SOURCES for %s:" (Md4.to_string t.md4);
       List.iter (fun (ip1, port, ip2) ->
           lprintf_nl "  %s:%d:%s" (Ip.to_string ip1) port(Ip.to_string ip2)) t.sources
-        
-    let write buf t = 
+
+    let write buf t =
       buf_int16 buf (List.length t.sources);
       buf_md4 buf t.md4;
-      List.iter (fun (ip1, port, ip2) -> 
+      List.iter (fun (ip1, port, ip2) ->
           buf_ip buf ip1;
           buf_port buf port;
           buf_ip buf ip2) t.sources
   end
-  
 
-      
-module EmuleClientInfo = struct 
+module EmuleClientInfo = struct
 
     type t = {
         version : int; (* CURRENT_VERSION_SHORT = !!emule_protocol_version *)
         protversion : int; (* EMULE_PROTOCOL_VERSION = 0x1 *)
         mutable tags : tag list;
       }
-      
+
     let names_of_tag =
       [
         "\032", "compression";
@@ -815,78 +797,78 @@
         "\161", "dev_wombat";
       ]
 
-    let names_of_tag = 
+    let names_of_tag =
       List.map (fun (v, name) -> (v, Field_UNKNOWN name)) names_of_tag
-      
+
     let parse len s =
       let version = get_uint8 s 1 in
       let protversion = get_uint8 s 2 in
       let tags,_ = get_tags s 3 names_of_tag in
       {
-        version = version; 
+        version = version;
         protversion = protversion;
         tags = tags;
       }
-      
-    let print m t = 
+
+    let print m t =
       lprintf_nl "%s:" m;
       lprintf_nl "  version: %d" t.version;
       lprintf_nl "  protversion: %d" t.version;
-      lprintf "  tags: "; 
+      lprintf "  tags: ";
       print_tags t.tags;
       lprint_newline ()
-        
-    let write buf t = 
+
+    let write buf t =
       buf_int8 buf t.version;
       buf_int8 buf t.protversion;
       buf_tags buf t.tags names_of_tag;
-      
+
   end
-      
-module EmuleQueueRanking = struct 
+
+module EmuleQueueRanking = struct
 
     type t = int
-      
-    let parse len s = get_int16 s 1      
-    let print t = 
+
+    let parse len s = get_int16 s 1
+    let print t =
       lprintf_nl "QUEUE RANKING: %d" t
 
     let string_null10 = String.make 10 (char_of_int 0)
-      
-    let write buf t = 
+
+    let write buf t =
       buf_int16 buf t;
       Buffer.add_string buf string_null10
-            
+
   end
 
-module QueueRank = struct 
+module QueueRank = struct
 
     type t = int
-      
-    let parse len s = get_int s 1      
-    let print t = 
+
+    let parse len s = get_int s 1
+    let print t =
       lprintf_nl "QUEUE RANK: %d" t
 
-    let write buf t = 
+    let write buf t =
       buf_int buf t
-            
+
   end
-      
-module EmuleRequestSources = struct 
+
+module EmuleRequestSources = struct
 
     type t =  Md4.t
-      
-    let parse len s = 
+
+    let parse len s =
       get_md4 s 1
-      
-    let print t = 
+
+    let print t =
       lprintf_nl "EMULE REQUEST SOURCES: %s" (Md4.to_string t)
 
-    let write buf t = 
-      buf_md4 buf t 
-            
+    let write buf t =
+      buf_md4 buf t
+
   end
-      
+
 
 let buf_estring buf s =
   let len = String.length s in
@@ -896,10 +878,10 @@
 module EmuleSignatureReq = struct
 
     type t = {
-        signature : string; 
-        ip_type : int; 
+        signature : string;
+        ip_type : int;
       }
-    
+
     let print t =
       lprintf_nl "EmuleSignatureReq [type %d] [sig(%d): %s]" t.ip_type (String.length t.signature) (String.escaped t.signature)
 
@@ -915,7 +897,7 @@
 
     let write buf t =
       buf_estring buf t.signature;
-      if (t.ip_type <> 0) then 
+      if (t.ip_type <> 0) then
            buf_int8 buf t.ip_type;
 
   end
@@ -930,8 +912,8 @@
 
     let parse len s =
       let len = get_uint8 s 1 in
-      String.sub s 2 len 
-    
+      String.sub s 2 len
+
     let write buf t =
       buf_estring buf t
 
@@ -940,14 +922,14 @@
 module EmuleSecIdentStateReq = struct
 
     type t = {
-        state : int; 
-        challenge : int64; 
+        state : int;
+        challenge : int64;
       }
 
-    let print t = 
+    let print t =
       lprintf_nl "EmuleSecIdentStateReq [state: %d] [challenge: %Ld]" t.state t.challenge
 
-    let parse len s = 
+    let parse len s =
       let state = get_uint8 s 1 in
       let challenge = get_uint64_32 s 2 in
       {
@@ -955,14 +937,14 @@
         challenge = challenge;
       }
 
-    let write buf t = 
+    let write buf t =
       buf_int8 buf t.state;
       buf_int64_32 buf t.challenge
-            
+
   end
-      
-module EmuleRequestSourcesReply = struct 
-    
+
+module EmuleRequestSourcesReply = struct
+
     type source = {
         src_ip : Ip.t;
         src_port : int;
@@ -970,12 +952,12 @@
         mutable src_server_port : int;
         mutable src_md4 : Md4.t;
       }
-    
+
     type t = {
         md4 : Md4.t;
-        sources : source array;        
+        sources : source array;
       }
-    
+
     let dummy_source = {
         src_ip = Ip.null;
         src_port = 0;
@@ -983,18 +965,18 @@
         src_server_port = 0;
         src_md4 = Md4.null;
       }
-    
-    let parse e len s = 
+
+    let parse e len s =
       let md4 = get_md4 s 1 in
       let ncount = get_int16 s 17 in
-      
-      let sources = 
+
+      let sources =
         if ncount = 0 then [||] else
         let slen = (len - 19) / ncount in
 (*        lprintf "PER SOURCES LEN: %d\n" slen; *)
         let sources = Array.create ncount dummy_source in
         let rec iter pos i =
-          if i < ncount then 
+          if i < ncount then
             let ss = {
                 dummy_source with
                 src_ip = get_ip s pos;
@@ -1010,7 +992,7 @@
                     end else
                     pos + 12
                 end
-              else pos + 6 
+              else pos + 6
             in
             sources.(i) <- ss;
             iter pos (i+1)
@@ -1022,43 +1004,42 @@
         md4 = md4;
         sources = sources;
       }
-        
-    let print t = 
+
+    let print t =
       let ncount = Array.length t.sources in
-      lprintf_nl "EMULE SOURCES REPLY: %d sources for %s" 
-        ncount (Md4.to_string t.md4); 
+      lprintf_nl "EMULE SOURCES REPLY: %d sources for %s"
+        ncount (Md4.to_string t.md4);
        for i = 0 to ncount - 1 do
         let s = t.sources.(i) in
           if Ip.valid s.src_ip then
             lprintf_nl "  %s:%d" (Ip.to_string s.src_ip) s.src_port
-          else 
+          else
             lprintf_nl "  Indirect from %s:%d"
               (Ip.to_string s.src_server_ip) s.src_server_port;
           if s.src_md4 != Md4.null then
             lprintf_nl "   Md4: %s" (Md4.to_string s.src_md4)
       done
 
-    let write e buf t = 
+    let write e buf t =
       buf_md4 buf t.md4;
       let ncount = Array.length t.sources in
       buf_int16 buf ncount;
-      
+
       for i = 0 to ncount - 1 do
         let s = t.sources.(i) in
           buf_ip buf s.src_ip;
-          buf_port buf s.src_port; 
+          buf_port buf s.src_port;
           if sourceexchange e > 0 then begin
               buf_ip buf s.src_server_ip;
-              buf_port buf s.src_server_port; 
+              buf_port buf s.src_server_port;
               if sourceexchange e > 1 then
                 buf_md4 buf s.src_md4
             end
       done
-            
+
   end
 
-  
-type t = 
+type t =
 | ConnectReq of Connect.t
 | ConnectReplyReq of ConnectReply.t
 | QueryFileReq of QueryFile.t
@@ -1082,10 +1063,9 @@
 | SourcesReq of Sources.t
 | EndOfDownloadReq of EndOfDownload.t
 | NewUserIDReq of NewUserID.t
-| NoSuchFileReq of NoSuchFile.t  
+| NoSuchFileReq of NoSuchFile.t
 | QueueRankReq of QueueRank.t
-  
-  
+
 | EmuleClientInfoReq of EmuleClientInfo.t
 | EmuleClientInfoReplyReq of EmuleClientInfo.t
 | EmuleQueueRankingReq of EmuleQueueRanking.t
@@ -1093,12 +1073,12 @@
 | EmuleRequestSourcesReplyReq of EmuleRequestSourcesReply.t
 | EmuleFileDescReq of string
 | EmulePublicKeyReq of EmulePublicKeyReq.t
-| EmuleSignatureReq of EmuleSignatureReq.t 
+| EmuleSignatureReq of EmuleSignatureReq.t
 | EmuleSecIdentStateReq  of EmuleSecIdentStateReq.t
 | EmuleMultiPacketReq of Md4.t * t list
 | EmuleMultiPacketAnswerReq of Md4.t * t list
 | EmuleCompressedPart of Md4.t * int64 * int64 * string
-  
+
 let rec print t =
   begin
     match t with
@@ -1111,35 +1091,35 @@
     | JoinQueueReq t -> JoinQueue.print t
     | AvailableSlotReq t -> AvailableSlot.print t
     | ReleaseSlotReq t -> ReleaseSlot.print t
-    | CloseSlotReq t -> CloseSlot.print t    
-    | QueryChunksReq t -> QueryChunks.print t    
-    | QueryChunksReplyReq t -> QueryChunksReply.print t    
-    | QueryChunkMd4Req t -> QueryChunkMd4.print t    
-    | QueryChunkMd4ReplyReq t -> QueryChunkMd4Reply.print t    
+    | CloseSlotReq t -> CloseSlot.print t
+    | QueryChunksReq t -> QueryChunks.print t
+    | QueryChunksReplyReq t -> QueryChunksReply.print t
+    | QueryChunkMd4Req t -> QueryChunkMd4.print t
+    | QueryChunkMd4ReplyReq t -> QueryChunkMd4Reply.print t
     | ViewFilesReplyReq t -> ViewFilesReply.print t
-    | ViewFilesReq t -> ViewFiles.print t    
-    | QueueReq t -> OtherLocations.print t    
+    | ViewFilesReq t -> ViewFiles.print t
+    | QueueReq t -> OtherLocations.print t
     | OtherLocationsReq t  -> OtherLocations.print t
     | SayReq t -> Say.print t
     | SourcesReq t -> Sources.print t
     | EndOfDownloadReq t -> EndOfDownload.print t
     | NewUserIDReq t -> NewUserID.print t
     | NoSuchFileReq t -> NoSuchFile.print t
-    | QueueRankReq t -> 
+    | QueueRankReq t ->
         QueueRank.print t
-    
-    | EmuleClientInfoReq t -> 
+
+    | EmuleClientInfoReq t ->
         EmuleClientInfo.print "EMULE CLIENT INFO"  t
-    | EmuleClientInfoReplyReq t -> 
+    | EmuleClientInfoReplyReq t ->
         EmuleClientInfo.print "EMULE CLIENT INFO REPLY" t
-    | EmuleQueueRankingReq t -> 
+    | EmuleQueueRankingReq t ->
         EmuleQueueRanking.print t
-    | EmuleRequestSourcesReq t -> 
+    | EmuleRequestSourcesReq t ->
         EmuleRequestSources.print  t
-    | EmuleRequestSourcesReplyReq t -> 
+    | EmuleRequestSourcesReplyReq t ->
         EmuleRequestSourcesReply.print t
 
-    | EmuleFileDescReq t -> 
+    | EmuleFileDescReq t ->
         lprintf "EMULE FILE DESC %s" t
 
     | EmuleMultiPacketReq (md4, list) ->
@@ -1148,7 +1128,7 @@
             lprintf "  ";
             print t
         ) list
-        
+
     | EmuleMultiPacketAnswerReq (md4, list) ->
         lprintf_nl "EmuleMultiPacketAnswer for %s:" (Md4.to_string md4);
         List.iter (fun t ->
@@ -1157,18 +1137,18 @@
         ) list
     | EmuleSecIdentStateReq t ->
         EmuleSecIdentStateReq.print t
-    | EmuleSignatureReq t -> 
-        EmuleSignatureReq.print t 
+    | EmuleSignatureReq t ->
+        EmuleSignatureReq.print t
     | EmulePublicKeyReq t ->
         EmulePublicKeyReq.print t
 
     | EmuleCompressedPart (md4, statpos, newsize, bloc) ->
         lprintf_nl "EmuleCompressedPart for %s %Ld %Ld len %d"
           (Md4.to_string md4) statpos newsize (String.length bloc)
-        
-    | UnknownReq (opcode, s) ->  
+
+    | UnknownReq (opcode, s) ->
         let len = String.length s in
-        lprintf_nl "UnknownReq: magic %d, opcode %d\n   len %d" opcode 
+        lprintf_nl "UnknownReq: magic %d, opcode %d\n   len %d" opcode
         (int_of_char s.[0])
         (String.length s);
         lprintf "ascii: [";
@@ -1185,34 +1165,31 @@
         for i = 0 to len - 1 do
           let c = s.[i] in
           let n = int_of_char c in
-          lprintf "(%d)" n            
+          lprintf "(%d)" n
         done;
         lprintf_nl "]"
   end
 
-  
 let rec parse_emule_packet emule opcode len s =
 (*
   lprintf "Emule magic: %d opcode %d:" magic opcode; lprint_newline ();
           dump s; lprint_newline ();
-  *)        
+  *)
   let t = match opcode with
     | 1 -> EmuleClientInfoReq (EmuleClientInfo.parse len s)
     | 2 -> EmuleClientInfoReplyReq (EmuleClientInfo.parse len s)
-    
-    
-    
+
     | 0x60 (* 96 *) -> EmuleQueueRankingReq (EmuleQueueRanking.parse len s)
-    
-    | 0x61 (* 97 *) -> 
+
+    | 0x61 (* 97 *) ->
         let (comment,_) = get_string s 1 in
         EmuleFileDescReq comment
-    
+
     | 0x81 (* 129 *) -> EmuleRequestSourcesReq (EmuleRequestSources.parse len s)
-    | 0x82 (* 130 *) -> 
+    | 0x82 (* 130 *) ->
         EmuleRequestSourcesReplyReq (
           EmuleRequestSourcesReply.parse emule len s)
-    
+
     | 0x40 (* 64 *) ->
 (* OP_COMPRESSEDPART *)
         let md4 = get_md4 s 1 in
@@ -1220,32 +1197,32 @@
         let newsize = get_uint64_32 s 21 in
         let bloc = String.sub s 25 (len-25) in
         EmuleCompressedPart (md4, statpos, newsize, bloc)
-    
-    | 0x85 (* 133 *) -> 
+
+    | 0x85 (* 133 *) ->
         EmulePublicKeyReq(EmulePublicKeyReq.parse len s)
-    
-    | 0x86 (* 134 *) -> 
+
+    | 0x86 (* 134 *) ->
         EmuleSignatureReq(EmuleSignatureReq.parse len s)
-    
-    | 0x87 (* 135 *) -> 
+
+    | 0x87 (* 135 *) ->
         EmuleSecIdentStateReq (EmuleSecIdentStateReq.parse len s)
 
 (*     | 0x90 (* 144 *) -> RequestPreview *)
 (*    | 0x91 (* 145 *) -> PreviewAnswer *)
-    | 0x92 (* 146 *) -> 
+    | 0x92 (* 146 *) ->
         let md4 = get_md4 s 1 in
-        
-(*        Printf.printf "MULTI EMULE VERSION %d" 
+
+(*        Printf.printf "MULTI EMULE VERSION %d"
           (extendedrequest emule); print_newline (); *)
         let pos = 17 in
         let rec iter pos =
           if pos < len then
             let opcode = get_uint8 s pos in
             match opcode with
-              0x58 (* 88 *) -> 
+              0x58 (* 88 *) ->
                 let bitmap, pos = get_bitmap s (pos+1) in
-                let ncompletesources, pos = 
-                  if extendedrequest emule > 1 then 
+                let ncompletesources, pos =
+                  if extendedrequest emule > 1 then
                     get_int16 s pos, pos+2
                   else -1, pos
                 in
@@ -1253,9 +1230,9 @@
                     QueryFile.md4 = md4;
                     QueryFile.emule_extension = Some (bitmap, ncompletesources);
                   }) :: (iter pos)
-            | 0x4F (* 79 *) -> 
+            | 0x4F (* 79 *) ->
                 (QueryChunksReq md4) :: iter (pos+1)
-            | 0x81 (* 129 *) -> 
+            | 0x81 (* 129 *) ->
                 (EmuleRequestSourcesReq md4) :: iter (pos+1)
             | _ ->
                 lprintf_nl "Unknown short emule packet %d" opcode;
@@ -1264,20 +1241,20 @@
             []
         in
         EmuleMultiPacketReq (md4, iter 17)
-    
-    | 0x93 (* 147 *) -> 
+
+    | 0x93 (* 147 *) ->
         let md4 = get_md4 s 1 in
-        
-(*        Printf.printf "MULTI EMULE VERSION %d" 
+
+(*        Printf.printf "MULTI EMULE VERSION %d"
           (extendedrequest emule); print_newline (); *)
         let rec iter s pos len =
           if pos < len then
             let opcode = get_uint8 s pos in
             match opcode with
-            | 89 -> 
+            | 89 ->
                 let module Q = QueryFileReply in
                 let name, pos = get_string s (pos+1) in
-                let q = { 
+                let q = {
                     Q.md4 = md4;
                     Q.name =  name;
                   } in
@@ -1297,7 +1274,7 @@
             []
         in
         EmuleMultiPacketAnswerReq (md4, iter s 17 len)
-    
+
     | code ->
         if !CommonOptions.verbose_unknown_messages then
           lprintf_nl "EDK: unknown eMule message %d" code;
@@ -1310,7 +1287,7 @@
   t
 
 and parse emule_version magic s =
-  try 
+  try
     let len = String.length s in
     if len = 0 then raise Not_found;
     let opcode = int_of_char (s.[0]) in
@@ -1318,7 +1295,7 @@
     match magic with
       227 ->
         begin
-          match opcode with 
+          match opcode with
           | 1 -> ConnectReq (Connect.parse len s)
           | 70 -> BlocReq (Bloc.parse len s)
           | 71 -> QueryBlocReq (QueryBloc.parse len s)
@@ -1334,7 +1311,7 @@
           | 81 -> QueryChunkMd4Req (QueryChunkMd4.parse len s)
           | 82 -> QueryChunkMd4ReplyReq (QueryChunkMd4Reply.parse len s)
 (* JoinQueue: the sender wants to join the upload queue *)
-          | 84 -> JoinQueueReq (JoinQueue.parse len s) 
+          | 84 -> JoinQueueReq (JoinQueue.parse len s)
 (* AvailableSlot: there is an available slot in upload queue *)
           | 85 -> AvailableSlotReq (AvailableSlot.parse len s)
 (* ReleaseSlot: the upload is finished *)
@@ -1344,25 +1321,24 @@
           | 88 -> QueryFileReq (QueryFile.parse emule_version len s)
           | 89 -> QueryFileReplyReq (QueryFileReply.parse len s)
           | 92 -> QueueRankReq (QueueRank.parse len s)
-          | 250 -> SourcesReq (Sources.parse len s)        
-          
+          | 250 -> SourcesReq (Sources.parse len s)
+
           | _ -> raise Not_found
-        end 
-    
+        end
+
     | 0xc5  -> (* 197: emule extended protocol *)
         parse_emule_packet emule_version opcode len s
 
 (* Compressed packet, probably sent by cDonkey ? *)
-    
+
     | 0xD4 -> (* 212 *)
-        
-        if Autoconf.has_zlib then
+
           let s = Autoconf.zlib__uncompress_string2 (String.sub s 1 (len-1)) in
           let s = Printf.sprintf "%c%s" (char_of_int opcode) s in
-          try
+	  begin try
             parse_emule_packet emule_version opcode (String.length s) s
           with
-          | e -> 
+          | e ->
               if !CommonOptions.verbose_unknown_messages then begin
                   lprintf_nl "Unknown message From client: %s (magic %d)"
                     (Printexc2.to_string e) magic;
@@ -1373,23 +1349,14 @@
                   lprint_newline ();
                 end;
               UnknownReq (magic,s)
-              
-        else
-          failwith "No Zlib to uncompress packet"
-        (*
-        lprintf "Compressed message decompressed with opcode %d" opcode; lprint_newline ();
-        if !CommonOptions.verbose_unknown_messages then begin       
-            let tmp_file = Filename.temp_file "comp" "unpak" in
-            File.from_string tmp_file s;
-            lprintf "Saved compressed packet %s" tmp_file; lprint_newline ();
-          end;	   
-        UnknownReq s        *)
-    | _ -> 
+	  end
+
+    | _ ->
         if !CommonOptions.verbose_unknown_messages then
             lprintf_nl "Strange magic: %d" magic;
         raise Not_found
   with
-  | e -> 
+  | e ->
       if !CommonOptions.verbose_unknown_messages then begin
           lprintf_nl "Unknown message From client: %s (magic %d)"
               (Printexc2.to_string e) magic;
@@ -1401,37 +1368,37 @@
           lprint_newline ();
         end;
       UnknownReq (magic,s)
-  
+
 let write emule buf t =
   let magic = match t with
       EmuleMultiPacketAnswerReq _
-    | EmuleMultiPacketReq _ 
-    | EmuleSecIdentStateReq _ 
+    | EmuleMultiPacketReq _
+    | EmuleSecIdentStateReq _
     | EmuleSignatureReq _
     | EmulePublicKeyReq _
     | EmuleRequestSourcesReplyReq _
-    | EmuleRequestSourcesReq _ 
+    | EmuleRequestSourcesReq _
     | EmuleClientInfoReplyReq _
     | EmuleClientInfoReq _
     | EmuleFileDescReq _
     | EmuleQueueRankingReq _
     | EmuleCompressedPart _
       -> 0xC5
-    | _ 
+    | _
       ->  227
   in
   begin
     match t with
-    | ConnectReq t -> 
+    | ConnectReq t ->
         buf_int8 buf 1;
         Connect.write buf t
-    | ConnectReplyReq t -> 
+    | ConnectReplyReq t ->
         buf_int8 buf 76;
         ConnectReply.write buf t
-    | QueryFileReq t -> 
+    | QueryFileReq t ->
         buf_int8 buf 88;
         QueryFile.write emule buf t
-    | QueryFileReplyReq t -> 
+    | QueryFileReplyReq t ->
         buf_int8 buf 89;
         QueryFileReply.write buf t
     | QueueReq t ->
@@ -1440,37 +1407,37 @@
     | QueryBlocReq t ->
         buf_int8 buf 71;
         QueryBloc.write buf t
-    | BlocReq t -> 
+    | BlocReq t ->
         buf_int8 buf 70;
         Bloc.write buf t
-    | JoinQueueReq t -> 
+    | JoinQueueReq t ->
         buf_int8 buf 84;
         JoinQueue.write emule buf t
-    | QueryChunksReq t -> 
+    | QueryChunksReq t ->
         buf_int8 buf 79;
         QueryChunks.write buf t
-    | QueryChunksReplyReq t -> 
+    | QueryChunksReplyReq t ->
         buf_int8 buf 80;
         QueryChunksReply.write buf t
-    | QueryChunkMd4Req t -> 
+    | QueryChunkMd4Req t ->
         buf_int8 buf 81;
         QueryChunkMd4.write buf t
-    | QueryChunkMd4ReplyReq t -> 
+    | QueryChunkMd4ReplyReq t ->
         buf_int8 buf 82;
         QueryChunkMd4Reply.write buf t
-    | AvailableSlotReq t -> 
+    | AvailableSlotReq t ->
         buf_int8 buf 85;
         AvailableSlot.write buf t
-    | ReleaseSlotReq t -> 
+    | ReleaseSlotReq t ->
         buf_int8 buf 86;
         ReleaseSlot.write buf t
-    | CloseSlotReq t -> 
+    | CloseSlotReq t ->
         buf_int8 buf 87;
         CloseSlot.write buf t
-    | ViewFilesReq t -> 
+    | ViewFilesReq t ->
         buf_int8 buf 74;
         ViewFiles.write buf t
-    | ViewFilesReplyReq t -> 
+    | ViewFilesReplyReq t ->
         buf_int8 buf 75;
         ViewFilesReply.write buf t
     | OtherLocationsReq t ->
@@ -1494,7 +1461,7 @@
     | QueueRankReq t ->
         buf_int8 buf 92;
         QueueRank.write buf t
-    
+
     | EmuleClientInfoReq t ->
         buf_int8 buf 1;
         EmuleClientInfo.write buf t
@@ -1521,7 +1488,7 @@
         buf_int64_32 buf statpos;
         buf_int64_32 buf newsize;
         Buffer.add_string buf bloc
-        
+
     | EmuleMultiPacketReq (md4, list) ->
         buf_int8 buf 0x92;
         buf_md4 buf md4;
@@ -1539,12 +1506,12 @@
                 buf_int8 buf 0x4F
             | EmuleRequestSourcesReq _ ->
                 buf_int8 buf 0x81
-            | _ -> 
+            | _ ->
                 lprintf_nl "WARNING: Don't know how to write short packet:";
                 print t;
                 print_newline ();
         ) list
-    
+
     | EmuleMultiPacketAnswerReq (md4, list) ->
         buf_int8 buf 0x93;
         buf_md4 buf md4;
@@ -1556,40 +1523,37 @@
             | QueryChunksReplyReq t ->
                 buf_int8 buf 80;
                 write_bitmap buf t.QueryChunksReply.chunks
-            | _ -> 
+            | _ ->
                 lprintf_nl "WARNING: Don't know how to write short packet:";
                 print t;
                 print_newline ();
         ) list
-        
-        
+
     | EmuleSecIdentStateReq t ->
         buf_int8 buf 0x87;
         EmuleSecIdentStateReq.write buf t
-        
-    | EmuleSignatureReq t ->  
+
+    | EmuleSignatureReq t ->
         buf_int8 buf 0x86;
         EmuleSignatureReq.write buf t
-       
+
     | EmulePublicKeyReq t ->
         buf_int8 buf 0x85;
         EmulePublicKeyReq.write buf t
-        
+
     | UnknownReq (opcode, s) ->
         Buffer.add_string buf s
-    
-  end;
-  magic 
-  
-(*
 
+  end;
+  magic
 
+(*
 ------------------------------------------------------
 1044008574.297 192.168.0.3:37522 -> 80.26.114.12:13842 of len 6
 ? Become Friend ? ping ?
 
 (227)(1)(0)(0)(0)
-(98) 
+(98)
 
 ------------------------------------------------------
 1044008576.274 80.26.114.12:13842 -> 192.168.0.3:37522 of len 6
@@ -1600,7 +1564,7 @@
 ------------------------------------------------------
 1044008687.977 192.168.0.3:37522 -> 80.26.114.12:13842 of len 6
 Browse Main Dir
-  
+
 (227)(1)(0)(0)(0)
 (93)
 
@@ -1617,7 +1581,7 @@
 ------------------------------------------------------
 1044008766.137 192.168.0.3:37522 -> 80.26.114.12:13842 of len 20
 Browse directory
-  
+
 (227)(15)(0)(0)(0)
 (94)
 (12)(0) C : \ D o w n l o a d s
@@ -1626,7 +1590,7 @@
 1044008769.045 80.26.114.12:13842 -> 192.168.0.3:37522 of len 300
 (227) p(8)(0)(0) `(12)(0) C : \ D o w n l o a d s(21)(0)(0)(0)(152) 2(229)(158)(218)(141)(217)(138) n(181) 6 ( ) h V(179)(0)(0)(0)(0)(0)(0)(3)(0)(0)(0)(2)(1)(0)(1)(11)(0) d e s k t o p . i n i(3)(1)(0)(2)(180)(0)(0)(0)(3)(1)(0)(19)(0)(0)(0)(0) y(16)(15) 9 O Z(219) i e(200)(10) |(29)(27) F(128)(0)(0)(0)(0)(0)(0)(5)(0)(0)(0)(2)(1)(0)(1)(15)(0) u t b o n u s p a c k . z i p(3)(1)(0)(2) J(16)(221)(0)(2)(1)(0)(3)(3)(0) P r o(2)(1)(0)(4)(3)(0) z i p(3)(1)(0)(19)(0)(0)(0)(0)(178)(145)(161)(146) P(199)(228)(249) K a :(9)(237)(246)(233) v(0)(0)(0)(0)(0)(0)(5)(0)(0)(0)(2)(1)(0)(1)(11)(0) c t f m a p s . z i p(3)(1)(0)(2)(236)(239)(23)(0)(2)(1)(0)(3)(3)(0) P r o(2)(1)(0)(4)(3)(0) z i p(3)(1)(0)(19)(0)(0)(0)(0) a n(251)(225) ^ g(205)(133)(25)(12) # ' J A(221) `(0)(0)(0)(0)(0)(0)(5)(0)(0)(0)(2)(1)(0)(1)(23)(0) u t i n o x x p a c k - n o - u m o d . z i p(3)(1)(0)(2)]
 (227)(112)(8)(0)(0)
-  
+
 (96)
 (12)(0) C : \ D o w n l o a d s
 (21)(0)(0)(0) 21 files
@@ -1665,7 +1629,7 @@
 (1)(0)(19)
 (0)(0)(0)(0)
 ....
-  
+
 *)
-      
+
 (* 92: Queue Rank *)
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyProtoCom.ml ./src/networks/donkey/donkeyProtoCom.ml
--- ./src/networks/donkey/donkeyProtoCom.ml	2005-09-06 13:24:59.000000000 +0200
+++ ./src/networks/donkey/donkeyProtoCom.ml	2005-09-22 17:02:29.000000000 +0200
@@ -353,7 +353,7 @@
          lprintf_nl () "Sending %d share(s) to server : " nfiles;
       Buffer.reset buf;
       let s_c =
-        if compressed && Autoconf.has_zlib then
+        if compressed then
           Autoconf.zlib__compress_string s
         else
           s
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyProtoServer.ml ./src/networks/donkey/donkeyProtoServer.ml
--- ./src/networks/donkey/donkeyProtoServer.ml	2005-09-17 19:50:38.000000000 +0200
+++ ./src/networks/donkey/donkeyProtoServer.ml	2005-09-22 17:02:29.000000000 +0200
@@ -1132,15 +1132,10 @@
               raise Not_found
         end
     | 0xD4 -> (* 212 *)
-
-(*        lprintf "Compressed Message...\n"; *)
-
-        if Autoconf.has_zlib then
           let s = Autoconf.zlib__uncompress_string2 (String.sub s 1 (len-1)) in
           let s = Printf.sprintf "%c%s" (char_of_int opcode) s in
           parse 227 s
-        else
-          failwith "No Zlib to uncompress packet"
+
     | _ ->
         failwith (Printf.sprintf "Unknown opcode %d from server\n" opcode)
   with
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/gnutella/gnutellaProto.ml ./src/networks/gnutella/gnutellaProto.ml
--- ./src/networks/gnutella/gnutellaProto.ml	2005-09-06 13:24:59.000000000 +0200
+++ ./src/networks/gnutella/gnutellaProto.ml	2005-09-22 17:02:29.000000000 +0200
@@ -847,13 +847,10 @@
   let table = !cached_qrt_table in
   
   let compressor, table =
-    if Autoconf.has_zlib then
       1, 
       let t = Autoconf.zlib__compress_string table in
       assert (Autoconf.zlib__uncompress_string2 t = table);
       t
-    else
-      0, table 
   in
   
   server_send_qrt_patch s {
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/gnutella2/g2Proto.ml ./src/networks/gnutella2/g2Proto.ml
--- ./src/networks/gnutella2/g2Proto.ml	2005-09-06 13:24:59.000000000 +0200
+++ ./src/networks/gnutella2/g2Proto.ml	2005-09-22 17:02:29.000000000 +0200
@@ -1452,10 +1452,7 @@
   let table = !cached_qrt_table in
   
   let compressor, table =
-    if Autoconf.has_zlib then
       1, Autoconf.zlib__compress_string table
-    else
-      0, table 
   in
   
   server_send_qrt_patch s {
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/autoconf.ml.new.in ./src/utils/lib/autoconf.ml.new.in
--- ./src/utils/lib/autoconf.ml.new.in	2005-09-08 14:44:53.000000000 +0200
+++ ./src/utils/lib/autoconf.ml.new.in	2005-09-22 17:02:29.000000000 +0200
@@ -8,7 +8,10 @@
 let glibc_version = "@GLIBC_VERSION@"
 let build_system = "@BUILD_SYSTEM@"
 let configure_arguments = "@CONFIGURE_ARGUMENTS@"
+
 let system = "@SYSTEM@"
+let windows = system = "cygwin" || system = "mingw"
+
 let opennapster = "@OPEN_NAPSTER@"
 let gnutella = "@GNUTELLA@"
 let gnutella2 = "@GNUTELLA2@"
@@ -38,10 +41,10 @@
 let has_gd_jpg = @HAS_GD_JPG@
 
 let has_bzip2 = @HAS_BZIP2@
-let has_zlib = @HAS_ZLIB@
-let zlib__uncompress_string2 s = @ZLIB__UNCOMPRESS_STRING2@
-let zlib__compress_string s = @ZLIB__COMPRESS_STRING@
-let zlib__gzip_string s = @ZLIB__GZIP_STRING@
+
+let zlib__uncompress_string2 s = Zlib.uncompress_string2 s
+let zlib__compress_string s = Zlib.compress_string s
+let zlib__gzip_string s = Zlib.gzip_string s
 
 let sha1_version = "@SHA1_VERSION@"
 
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/net/basicSocket.ml ./src/utils/net/basicSocket.ml
--- ./src/utils/net/basicSocket.ml	2005-09-19 12:09:06.000000000 +0200
+++ ./src/utils/net/basicSocket.ml	2005-09-22 17:02:29.000000000 +0200
@@ -346,7 +346,7 @@
 
 let create name fd handler =
   MlUnix.set_nonblock fd;
-  if Autoconf.system <> "windows" then setsockopt fd SO_KEEPALIVE !socket_keepalive;
+  if not Autoconf.windows then setsockopt fd SO_KEEPALIVE !socket_keepalive;
   create_blocking name fd handler
 
 
