[gnutls-dev] LZO 2; configure problem; small logic patch
Sergey Lipnevich
sergey at optimaltec.com
Tue Jun 7 19:54:32 CEST 2005
Hi GNUTLS developers!
I was trying to make GNUTLS work with the latest version of LZO (2.0) for our
distro, SourceMage, and came upon the following minor problems, that I believe
are not related to packaging:
1. Configure script contains this piece of code, which essentially disables LZO
use if either --with-lzo or --without-lzo is given:
12197 # Check whether --with-lzo or --without-lzo was given.
12198 if test "${with_lzo+set}" = set; then
12199 withval="$with_lzo"
12200 use_lzo=no
12201 else
12202 use_lzo=yes
12203 fi;
It should probably be:
withval="$with_lzo"
use_lzo=$withval
2. LZO 2 is using <prefix>/include/lzo for include files, is it possible to
detect this? Also, the file libextra/lzoconfig.h is obsolete and should probably
be part of minilzo.h. The following patch will apply uniform logic in regards to
using MINILZO in gnutls_extra.c:
--- gnutls/libextra/gnutls_extra.c 2005-05-26 11:19:21.000000000 -0400
+++ gnutls/libextra/gnutls_extra.c 2005-06-07 13:12:09.000000000 -0400
@@ -29,7 +29,11 @@
#include <gnutls_extra.h>
#include <gnutls_algorithms.h>
#ifdef USE_LZO
-# include <minilzo.h>
+# ifdef USE_MINILZO
+# include "minilzo.h"
+# else
+# include <lzo1x.h>
+# endif
#endif
3. In case LZO is not required (USE_LZO undefined in config.h), the following
patch corrects a cleanup flow problem in the code:
--- gnutls/lib/gnutls_compress_int.c 2005-06-07 11:58:09.595990000 -0400
+++ gnutls/lib/gnutls_compress_int.c 2005-06-07 11:59:11.851880750 -0400
@@ -108,9 +108,7 @@ comp_hd_t _gnutls_comp_init(gnutls_compr
if (ret->handle == NULL) {
gnutls_assert();
- cleanup_ret:
- gnutls_free(ret);
- return NULL;
+ goto cleanup_ret;
}
}
@@ -120,6 +118,10 @@ comp_hd_t _gnutls_comp_init(gnutls_compr
break;
}
return ret;
+
+cleanup_ret:
+ gnutls_free(ret);
+ return NULL;
}
void _gnutls_comp_deinit(comp_hd_t handle, int d)
Please email me directly in case of questions. Thanks!
Sergey.
More information about the Gnutls-dev
mailing list