From 298d8567a0f13ca79fa9441afc3191b4570053e3 Mon Sep 17 00:00:00 2001 From: lparam Date: Wed, 16 Sep 2015 09:15:40 +0800 Subject: [PATCH] hotfix: crypto initialization --- CHANGES.md | 5 +++++ Makefile | 2 +- openwrt/Makefile | 2 +- src/common.h | 2 +- src/xforwarder.c | 4 ++-- src/xsocks.c | 4 ++-- src/xtproxy.c | 4 ++-- src/xtunnel.c | 8 ++++---- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 29f1f64..fe98a9b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +v0.2.6 (2015-9-16) +----------- +* Hotfix: Crypto init once only + + v0.2.5 (2015-9-15) ----------- * Fix: Crypto init once only diff --git a/Makefile b/Makefile index 19aabdd..4a708ed 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAJOR = 0 MINOR = 2 -PATCH = 5 +PATCH = 6 NAME = xsocks ifdef O diff --git a/openwrt/Makefile b/openwrt/Makefile index 506db58..c7375ee 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xsocks -PKG_VERSION:=0.2.5 +PKG_VERSION:=0.2.6 PKG_RELEASE= PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/src/common.h b/src/common.h index 01d1a5c..9bfea5f 100644 --- a/src/common.h +++ b/src/common.h @@ -4,7 +4,7 @@ #include "uv.h" #include "socks.h" -#define XSOCKS_VERSION "0.2.5" +#define XSOCKS_VERSION "0.2.6" struct server_context { int index; diff --git a/src/xforwarder.c b/src/xforwarder.c index 6ef5cd1..cad0028 100644 --- a/src/xforwarder.c +++ b/src/xforwarder.c @@ -227,8 +227,6 @@ main(int argc, char *argv[]) { return 1; } - init(); - #ifndef _WIN32 if (daemon_mode) { if (daemonize()) { @@ -241,6 +239,8 @@ main(int argc, char *argv[]) { } #endif + init(); + loop = uv_default_loop(); rc = resolve_addr(local_addr, &bind_addr); diff --git a/src/xsocks.c b/src/xsocks.c index 758c267..0895c8e 100644 --- a/src/xsocks.c +++ b/src/xsocks.c @@ -234,8 +234,6 @@ main(int argc, char *argv[]) { return 1; } - init(); - #if !defined(_WIN32) if (daemon_mode) { if (daemonize()) { @@ -248,6 +246,8 @@ main(int argc, char *argv[]) { } #endif + init(); + loop = uv_default_loop(); rc = resolve_addr(local_addr, &bind_addr); diff --git a/src/xtproxy.c b/src/xtproxy.c index f5cb4d2..9504505 100644 --- a/src/xtproxy.c +++ b/src/xtproxy.c @@ -216,8 +216,6 @@ main(int argc, char *argv[]) { return 1; } - init(); - if (daemon_mode) { if (daemonize()) { return 1; @@ -228,6 +226,8 @@ main(int argc, char *argv[]) { } } + init(); + loop = uv_default_loop(); rc = resolve_addr(local_addrbuf, &local_addr); diff --git a/src/xtunnel.c b/src/xtunnel.c index a3ccb7a..4c8f125 100644 --- a/src/xtunnel.c +++ b/src/xtunnel.c @@ -231,10 +231,6 @@ main(int argc, char *argv[]) { return 1; } - if (init()) { - return 1; - } - #ifndef _WIN32 if (daemon_mode) { if (daemonize()) { @@ -247,6 +243,10 @@ main(int argc, char *argv[]) { } #endif + if (init()) { + return 1; + } + loop = uv_default_loop(); rc = resolve_addr(source_addr, &bind_addr);