From 3993a6a4e7a76ac75f8507ebe92c247214affb6c Mon Sep 17 00:00:00 2001 From: ithewei Date: Thu, 25 Nov 2021 20:37:21 +0800 Subject: [PATCH] v1.2.3 --- CMakeLists.txt | 2 +- base/hversion.h | 2 +- event/hevent.c | 3 ++- http/client/AsyncHttpClient.h | 3 ++- http/server/HttpContext.h | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a8657aa8..099c68a38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) -project(hv VERSION 1.2.2) +project(hv VERSION 1.2.3) option(BUILD_SHARED "build shared library" ON) option(BUILD_STATIC "build static library" ON) diff --git a/base/hversion.h b/base/hversion.h index db2826f15..d88954c03 100644 --- a/base/hversion.h +++ b/base/hversion.h @@ -8,7 +8,7 @@ BEGIN_EXTERN_C #define HV_VERSION_MAJOR 1 #define HV_VERSION_MINOR 2 -#define HV_VERSION_PATCH 2 +#define HV_VERSION_PATCH 3 #define HV_VERSION_STRING STRINGIFY(HV_VERSION_MAJOR) "." \ STRINGIFY(HV_VERSION_MINOR) "." \ diff --git a/event/hevent.c b/event/hevent.c index 336950966..79c5fb583 100644 --- a/event/hevent.c +++ b/event/hevent.c @@ -717,8 +717,9 @@ int hio_write_kcp(hio_t* io, const void* buf, size_t len) { // printf("ikcp_send len=%d nsend=%d\n", (int)len, nsend); if (nsend < 0) { hio_close(io); + } else { + ikcp_update(kcp->ikcp, (IUINT32)io->loop->cur_hrtime / 1000); } - ikcp_update(kcp->ikcp, (IUINT32)io->loop->cur_hrtime / 1000); return nsend; } diff --git a/http/client/AsyncHttpClient.h b/http/client/AsyncHttpClient.h index f533a7c97..194f0b0e6 100644 --- a/http/client/AsyncHttpClient.h +++ b/http/client/AsyncHttpClient.h @@ -108,7 +108,8 @@ class AsyncHttpClient { loop_thread.start(true); } ~AsyncHttpClient() { - loop_thread.stop(true); + // NOTE: ~EventLoopThread will stop and join + // loop_thread.stop(true); } // thread-safe diff --git a/http/server/HttpContext.h b/http/server/HttpContext.h index d39a6a8e2..ec3582629 100644 --- a/http/server/HttpContext.h +++ b/http/server/HttpContext.h @@ -83,7 +83,7 @@ struct HV_EXPORT HttpContext { return request->GetForm(); } std::string form(const char* name, const std::string& defvalue = "") { - return request->GetFormData(name); + return request->GetFormData(name, defvalue); } // Content-Type: application/x-www-form-urlencoded @@ -91,7 +91,7 @@ struct HV_EXPORT HttpContext { return request->GetUrlEncoded(); } std::string urlencoded(const char* key, const std::string& defvalue = "") { - return request->GetUrlEncoded(key); + return request->GetUrlEncoded(key, defvalue); } // T=[bool, int, int64_t, float, double]