ithewei преди 4 години
родител
ревизия
3993a6a4e7
променени са 5 файла, в които са добавени 8 реда и са изтрити 6 реда
  1. 1 1
      CMakeLists.txt
  2. 1 1
      base/hversion.h
  3. 2 1
      event/hevent.c
  4. 2 1
      http/client/AsyncHttpClient.h
  5. 2 2
      http/server/HttpContext.h

+ 1 - 1
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)

+ 1 - 1
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) "." \

+ 2 - 1
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;
 }
 

+ 2 - 1
http/client/AsyncHttpClient.h

@@ -108,7 +108,8 @@ public:
         loop_thread.start(true);
     }
     ~AsyncHttpClient() {
-        loop_thread.stop(true);
+        // NOTE: ~EventLoopThread will stop and join
+        // loop_thread.stop(true);
     }
 
     // thread-safe

+ 2 - 2
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]