ithewei 6 年之前
父节点
当前提交
2fa7e25ee5
共有 20 个文件被更改,包括 315 次插入54 次删除
  1. 7 0
      .gitignore
  2. 5 2
      Makefile
  3. 1 2
      base/array.h
  4. 5 4
      base/hbase.c
  5. 1 1
      base/hbase.h
  6. 7 5
      base/hbuf.h
  7. 1 1
      base/hdef.h
  8. 1 0
      base/hplatform.h
  9. 1 1
      base/htime.c
  10. 1 2
      base/queue.h
  11. 2 2
      event/hloop.h
  12. 3 2
      event/kqueue.c
  13. 5 22
      event/nlog.c
  14. 0 2
      event/nlog.h
  15. 3 3
      event/nmap.cpp
  16. 2 2
      event/overlapio.c
  17. 7 1
      http/client/http_client.cpp
  18. 2 2
      http/server/http_server.cpp
  19. 28 0
      winbuild/libhw/libhw.sln
  20. 233 0
      winbuild/libhw/libhw.vcxproj

+ 7 - 0
.gitignore

@@ -28,3 +28,10 @@ dist
 
 # test
 test
+
+# msvc
+*.VC.db
+*.VC.VC.opendb
+*.vcxproj.filters
+Debug
+Release

+ 5 - 2
Makefile

@@ -3,7 +3,7 @@ TMPDIR=tmp
 
 default: all
 
-all: test ping timer loop tcp udp nc nmap httpd
+all: libhw test ping timer loop tcp udp nc nmap httpd
 
 clean:
 	$(MAKEF) clean SRCDIRS=". base utils event http http/client http/server examples $(TMPDIR)"
@@ -11,6 +11,9 @@ clean:
 prepare:
 	-mkdir -p $(TMPDIR)
 
+libhw:
+	$(MAKEF) TARGET=$@ TARGET_TYPE=STATIC SRCDIRS=". base utils event http http/client http/server"
+
 test: prepare
 	-rm $(TMPDIR)/*.o $(TMPDIR)/*.h $(TMPDIR)/*.c $(TMPDIR)/*.cpp
 	cp main.cpp.tmpl $(TMPDIR)/main.cpp
@@ -70,4 +73,4 @@ CURL_SRCS    += examples/curl.cpp base/hstring.cpp base/hbase.c
 curl:
 	$(MAKEF) TARGET=$@ SRCDIRS="$(CURL_SRCDIRS)" INCDIRS="$(CURL_INCDIRS)" SRCS="$(CURL_SRCS)" DEFINES="CURL_STATICLIB" LIBS="curl"
 
-.PHONY: clean prepare test ping timer loop tcp udp nc nmap httpd webbench curl
+.PHONY: clean prepare libhw test ping timer loop tcp udp nc nmap httpd webbench curl

+ 1 - 2
base/array.h

@@ -75,9 +75,8 @@ static inline void atype##_cleanup(atype* p) {\
 }\
 \
 static inline void atype##_resize(atype* p, int maxsize) {\
+    p->ptr = (type*)safe_realloc(p->ptr, sizeof(type) * maxsize, sizeof(type) * p->maxsize);\
     p->maxsize = maxsize;\
-    int bytes = sizeof(type) * maxsize;\
-    p->ptr = (type*)safe_realloc(p->ptr, bytes);\
 }\
 \
 static inline void atype##_double_resize(atype* p) {\

+ 5 - 4
base/hbase.c

@@ -17,16 +17,17 @@ void* safe_malloc(size_t size) {
     return ptr;
 }
 
-void* safe_realloc(void* oldptr, size_t size) {
+void* safe_realloc(void* oldptr, size_t newsize, size_t oldsize) {
     ++g_alloc_cnt;
     ++g_free_cnt;
-    void* ptr = realloc(oldptr, size);
+    void* ptr = realloc(oldptr, newsize);
     if (!ptr) {
         fprintf(stderr, "realloc failed!\n");
         exit(-1);
     }
-    if (!ptr) {
-
+    if (newsize > oldsize) {
+        int addsize = newsize - oldsize;
+        memset((char*)ptr + addsize, 0, addsize);
     }
     return ptr;
 }

+ 1 - 1
base/hbase.h

@@ -28,7 +28,7 @@ extern unsigned int g_alloc_cnt;
 extern unsigned int g_free_cnt;
 
 void* safe_malloc(size_t size);
-void* safe_realloc(void* oldptr, size_t size);
+void* safe_realloc(void* oldptr, size_t newsize, size_t oldsize);
 void* safe_calloc(size_t nmemb, size_t size);
 void* safe_zalloc(size_t size);
 

+ 7 - 5
base/hbuf.h

@@ -78,7 +78,7 @@ public:
             SAFE_ALLOC(base, cap);
         }
         else {
-            base = (char*)safe_realloc(base, cap);
+            base = (char*)safe_realloc(base, cap, len);
         }
         len = cap;
         cleanup_ = true;
@@ -110,8 +110,9 @@ public:
 
     void push_front(void* ptr, size_t len) {
         if (len > this->len - _size) {
-            this->len = MAX(this->len, len)*2;
-            base = (char*)safe_realloc(base, this->len);
+            size_t newsize = MAX(this->len, len)*2;
+            base = (char*)safe_realloc(base, newsize, this->len);
+            this->len = newsize;
         }
 
         if (_offset < len) {
@@ -127,8 +128,9 @@ public:
 
     void push_back(void* ptr, size_t len) {
         if (len > this->len - _size) {
-            this->len = MAX(this->len, len)*2;
-            base = (char*)safe_realloc(base, this->len);
+            size_t newsize = MAX(this->len, len)*2;
+            base = (char*)safe_realloc(base, newsize, this->len);
+            this->len = newsize;
         }
         else if (len > this->len - _offset - _size) {
             // move => start

+ 1 - 1
base/hdef.h

@@ -227,7 +227,7 @@ typedef void (*procedure_t)(void* userdata);
 #ifdef __GNUC__
 #define prefetch(x) __builtin_prefetch(x)
 #else
-#define prefetch(x)
+#define prefetch(x) (void)0
 #endif
 #endif
 

+ 1 - 0
base/hplatform.h

@@ -54,6 +54,7 @@
 #ifdef _MSC_VER
 #pragma warning (disable: 4100) // unused param
 #pragma warning (disable: 4819) // Unicode
+#pragma warning (disable: 4996) // _CRT_SECURE_NO_WARNINGS
 
 #undef  HAVE_PTHREAD_H
 #define HAVE_PTHREAD_H  0

+ 1 - 1
base/htime.c

@@ -17,7 +17,7 @@ static const uint8_t s_days[] = \
 //   1       3       5       7   8       10      12
     {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
-inline unsigned long long gethrtime() {
+unsigned long long gethrtime() {
 #ifdef OS_WIN
     static LONGLONG s_freq = 0;
     if (s_freq == 0) {

+ 1 - 2
base/queue.h

@@ -66,9 +66,8 @@ static inline void qtype##_cleanup(qtype* p) {\
 }\
 \
 static inline void qtype##_resize(qtype* p, int maxsize) {\
+    p->ptr = (type*)safe_realloc(p->ptr, sizeof(type)*maxsize, sizeof(type)*p->maxsize);\
     p->maxsize = maxsize;\
-    int bytes = sizeof(type) * maxsize;\
-    p->ptr = (type*)safe_realloc(p->ptr, bytes);\
 }\
 \
 static inline void qtype##_double_resize(qtype* p) {\

+ 2 - 2
event/hloop.h

@@ -40,8 +40,8 @@ typedef enum {
     HEVENT_TYPE_IO      = 0x00001000,
 } hevent_type_e;
 
-#define HEVENT_LOWEST_PRIORITY     -5
-#define HEVENT_LOW_PRIORITY        -3
+#define HEVENT_LOWEST_PRIORITY    (-5)
+#define HEVENT_LOW_PRIORITY       (-3)
 #define HEVENT_NORMAL_PRIORITY      0
 #define HEVENT_HIGH_PRIORITY        3
 #define HEVENT_HIGHEST_PRIORITY     5

+ 3 - 2
event/kqueue.c

@@ -25,8 +25,9 @@ typedef struct kqueue_ctx_s {
 
 static void kqueue_ctx_resize(kqueue_ctx_t* kqueue_ctx, int size) {
     int bytes = sizeof(struct kevent) * size;
-    kqueue_ctx->changes = (struct kevent*)safe_realloc(kqueue_ctx->changes, bytes);
-    kqueue_ctx->events = (struct kevent*)safe_realloc(kqueue_ctx->events, bytes);
+    int oldbytes = sizeof(struct kevent) * kqueue_ctx->capacity;
+    kqueue_ctx->changes = (struct kevent*)safe_realloc(kqueue_ctx->changes, bytes, oldbytes);
+    kqueue_ctx->events = (struct kevent*)safe_realloc(kqueue_ctx->events, bytes, oldbytes);
     kqueue_ctx->capacity = size;
 }
 

+ 5 - 22
event/nlog.c

@@ -18,13 +18,12 @@ typedef struct nlog_client {
 static network_logger_t s_logger = {0};
 
 static void on_close(hio_t* io) {
-    printf("on_close fd=%d error=%d\n", io->fd, io->error);
+    printd("on_close fd=%d error=%d\n", io->fd, io->error);
     struct list_node* next = s_logger.clients.next;
     nlog_client* client;
     while (next != &s_logger.clients) {
         client = list_entry(next, nlog_client, node);
         next = next->next;
-        printf("client->io=%p client->io->fd=%d io=%p io->fd=%d\n", client->io, client->io->fd, io, io->fd);
         if (client->io == io) {
             list_del(next->prev);
             SAFE_FREE(client);
@@ -34,16 +33,16 @@ static void on_close(hio_t* io) {
 }
 
 static void on_read(hio_t* io, void* buf, int readbytes) {
-    printf("on_read fd=%d readbytes=%d\n", io->fd, readbytes);
-    printf("< %s\n", buf);
+    printd("on_read fd=%d readbytes=%d\n", io->fd, readbytes);
+    printd("< %s\n", buf);
     // nothing to do
 }
 
 static void on_accept(hio_t* io, int connfd) {
-    printf("on_accept listenfd=%d connfd=%d\n", io->fd, connfd);
+    printd("on_accept listenfd=%d connfd=%d\n", io->fd, connfd);
     char localaddrstr[INET6_ADDRSTRLEN+16] = {0};
     char peeraddrstr[INET6_ADDRSTRLEN+16] = {0};
-    printf("accept listenfd=%d connfd=%d [%s] <= [%s]\n", io->fd, connfd,
+    printd("accept listenfd=%d connfd=%d [%s] <= [%s]\n", io->fd, connfd,
             sockaddr_snprintf(io->localaddr, localaddrstr, sizeof(localaddrstr)),
             sockaddr_snprintf(io->peeraddr, peeraddrstr, sizeof(peeraddrstr)));
 
@@ -73,19 +72,3 @@ hio_t* nlog_listen(hloop_t* loop, int port) {
     s_logger.listenio = create_tcp_server(loop, port, on_accept);
     return s_logger.listenio;
 }
-
-void nlog_close() {
-    if (s_logger.loop == NULL) return;
-    struct list_node* next = s_logger.clients.next;
-    nlog_client* client;
-    while (next != &s_logger.clients) {
-        client = list_entry(next, nlog_client, node);
-        next = next->next;
-        list_del(next->prev);
-        SAFE_FREE(client);
-    }
-    if (s_logger.listenio) {
-        hclose(s_logger.listenio);
-        s_logger.listenio = NULL;
-    }
-}

+ 0 - 2
event/nlog.h

@@ -15,7 +15,6 @@
     hlog_set_logger(network_logger);
     nlog_listen(&loop, DEFAULT_LOG_PORT);
     hloop_run(&loop);
-    nlog_close();
  */
 
 #include "hlog.h"
@@ -25,6 +24,5 @@
 
 void network_logger(int loglevel, const char* buf, int len);
 hio_t* nlog_listen(hloop_t* loop, int port);
-void nlog_close();
 
 #endif // HW_NLOG_H_

+ 3 - 3
event/nmap.cpp

@@ -12,15 +12,15 @@ typedef struct recvfrom_udata_s {
     int     up_cnt;
 } recvfrom_udata_t;
 
-void on_idle(hidle_t* idle) {
+static void on_idle(hidle_t* idle) {
     hloop_stop(idle->loop);
 }
 
-void on_timer(htimer_t* timer) {
+static void on_timer(htimer_t* timer) {
     hloop_stop(timer->loop);
 }
 
-void on_recvfrom(hio_t* io, void* buf, int readbytes) {
+static void on_recvfrom(hio_t* io, void* buf, int readbytes) {
     //printf("on_recv fd=%d readbytes=%d\n", io->fd, readbytes);
     //char localaddrstr[INET6_ADDRSTRLEN+16] = {0};
     //char peeraddrstr[INET6_ADDRSTRLEN+16] = {0};

+ 2 - 2
event/overlapio.c

@@ -123,7 +123,7 @@ static void on_connectex_complete(hio_t* io) {
     hoverlapped_t* hovlp = (hoverlapped_t*)io->hovlp;
     io->error = hovlp->error;
     SAFE_FREE(io->hovlp);
-    if (io->errno != 0) {
+    if (io->error != 0) {
         hclose(io);
         return;
     }
@@ -333,7 +333,7 @@ WSASend:
         hovlp->buf.len = len - nwrite;
         // NOTE: free on_send_complete
         SAFE_ALLOC(hovlp->buf.buf, hovlp->buf.len);
-        memcpy(hovlp->buf.buf, buf + nwrite, hovlp->buf.len);
+        memcpy(hovlp->buf.buf, ((char*)buf) + nwrite, hovlp->buf.len);
         hovlp->io = io;
         DWORD dwbytes = 0;
         DWORD flags = 0;

+ 7 - 1
http/client/http_client.cpp

@@ -6,6 +6,12 @@
 HttpClient based libcurl
 ***************************************************************/
 #include "curl/curl.h"
+#ifdef _MSC_VER
+#pragma comment(lib, "ws2_32.lib")
+#pragma comment(lib, "wldap32.lib")
+#pragma comment(lib, "advapi32.lib")
+#pragma comment(lib, "crypt32.lib")
+#endif
 
 //#include "hlog.h"
 
@@ -50,7 +56,7 @@ static size_t s_body_cb(char *buf, size_t size, size_t cnt, void *userdata) {
 }
 
 #include <atomic>
-static std::atomic_flag s_curl_global_init(false);
+static std::atomic_flag s_curl_global_init = ATOMIC_FLAG_INIT;
 int http_client_send(HttpRequest* req, HttpResponse* res, int timeout) {
     if (req == NULL || res == NULL) {
         return -1;

+ 2 - 2
http/server/http_server.cpp

@@ -143,7 +143,7 @@ static void on_accept(hio_t* io, int connfd) {
     connio->userdata = handler;
 }
 
-void handle_cached_files(htimer_t* timer) {
+static void handle_cached_files(htimer_t* timer) {
     FileCache* pfc = (FileCache*)timer->userdata;
     if (pfc == NULL) {
         htimer_del(timer);
@@ -164,7 +164,7 @@ void handle_cached_files(htimer_t* timer) {
     }
 }
 
-void fflush_log(hidle_t* idle) {
+static void fflush_log(hidle_t* idle) {
     hlog_fflush();
 }
 

+ 28 - 0
winbuild/libhw/libhw.sln

@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhw", "libhw.vcxproj", "{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Debug|x64.ActiveCfg = Debug|x64
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Debug|x64.Build.0 = Debug|x64
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Debug|x86.ActiveCfg = Debug|Win32
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Debug|x86.Build.0 = Debug|Win32
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Release|x64.ActiveCfg = Release|x64
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Release|x64.Build.0 = Release|x64
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Release|x86.ActiveCfg = Release|Win32
+		{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}.Release|x86.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 233 - 0
winbuild/libhw/libhw.vcxproj

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{1F0DF7C6-FF67-4EFE-B4E7-41233C726D26}</ProjectGuid>
+    <RootNamespace>libhw</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>../../;../../include;../../3rd/include;../../base;../../event;../../utils;../../http;../../http/client;../../http/server;</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Lib>
+      <AdditionalLibraryDirectories>../../lib;../../3rd/lib;</AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>../../;../../include;../../3rd/include;../../base;../../event;../../utils;../../http;../../http/client;../../http/server;</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Lib>
+      <AdditionalLibraryDirectories>../../lib;../../3rd/lib;</AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>../../;../../include;../../3rd/include;../../base;../../event;../../utils;../../http;../../http/client;../../http/server;</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+    <Lib>
+      <AdditionalLibraryDirectories>../../lib;../../3rd/lib;</AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>../../;../../include;../../3rd/include;../../base;../../event;../../utils;../../http;../../http/client;../../http/server;</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+    <Lib>
+      <AdditionalLibraryDirectories>../../lib;../../3rd/lib;</AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\base\array.h" />
+    <ClInclude Include="..\..\base\hbase.h" />
+    <ClInclude Include="..\..\base\hbuf.h" />
+    <ClInclude Include="..\..\base\hdef.h" />
+    <ClInclude Include="..\..\base\heap.h" />
+    <ClInclude Include="..\..\base\herr.h" />
+    <ClInclude Include="..\..\base\hfile.h" />
+    <ClInclude Include="..\..\base\hgui.h" />
+    <ClInclude Include="..\..\base\hlog.h" />
+    <ClInclude Include="..\..\base\hmath.h" />
+    <ClInclude Include="..\..\base\hmutex.h" />
+    <ClInclude Include="..\..\base\hobj.h" />
+    <ClInclude Include="..\..\base\hplatform.h" />
+    <ClInclude Include="..\..\base\hproc.h" />
+    <ClInclude Include="..\..\base\hscope.h" />
+    <ClInclude Include="..\..\base\hsocket.h" />
+    <ClInclude Include="..\..\base\hstring.h" />
+    <ClInclude Include="..\..\base\hsysinfo.h" />
+    <ClInclude Include="..\..\base\hthread.h" />
+    <ClInclude Include="..\..\base\hthreadpool.h" />
+    <ClInclude Include="..\..\base\htime.h" />
+    <ClInclude Include="..\..\base\hvar.h" />
+    <ClInclude Include="..\..\base\hversion.h" />
+    <ClInclude Include="..\..\base\list.h" />
+    <ClInclude Include="..\..\base\netinet.h" />
+    <ClInclude Include="..\..\base\queue.h" />
+    <ClInclude Include="..\..\event\hevent.h" />
+    <ClInclude Include="..\..\event\hio.h" />
+    <ClInclude Include="..\..\event\hloop.h" />
+    <ClInclude Include="..\..\event\iowatcher.h" />
+    <ClInclude Include="..\..\event\nlog.h" />
+    <ClInclude Include="..\..\event\nmap.h" />
+    <ClInclude Include="..\..\event\overlapio.h" />
+    <ClInclude Include="..\..\h.h" />
+    <ClInclude Include="..\..\hconfig.h" />
+    <ClInclude Include="..\..\http\client\http_client.h" />
+    <ClInclude Include="..\..\http\HttpParser.h" />
+    <ClInclude Include="..\..\http\HttpRequest.h" />
+    <ClInclude Include="..\..\http\http_content.h" />
+    <ClInclude Include="..\..\http\http_parser.h" />
+    <ClInclude Include="..\..\http\multipart_parser.h" />
+    <ClInclude Include="..\..\http\server\FileCache.h" />
+    <ClInclude Include="..\..\http\server\HttpHandler.h" />
+    <ClInclude Include="..\..\http\server\HttpService.h" />
+    <ClInclude Include="..\..\http\server\http_server.h" />
+    <ClInclude Include="..\..\utils\base64.h" />
+    <ClInclude Include="..\..\utils\hbytearray.h" />
+    <ClInclude Include="..\..\utils\hendian.h" />
+    <ClInclude Include="..\..\utils\hframe.h" />
+    <ClInclude Include="..\..\utils\hgl.h" />
+    <ClInclude Include="..\..\utils\hmain.h" />
+    <ClInclude Include="..\..\utils\htask.h" />
+    <ClInclude Include="..\..\utils\ifconfig.h" />
+    <ClInclude Include="..\..\utils\iniparser.h" />
+    <ClInclude Include="..\..\utils\json.hpp" />
+    <ClInclude Include="..\..\utils\md5.h" />
+    <ClInclude Include="..\..\utils\singleton.h" />
+    <ClInclude Include="..\..\utils\task_queue.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\base\hbase.c" />
+    <ClCompile Include="..\..\base\herr.c" />
+    <ClCompile Include="..\..\base\hlog.c" />
+    <ClCompile Include="..\..\base\hsocket.c" />
+    <ClCompile Include="..\..\base\hstring.cpp" />
+    <ClCompile Include="..\..\base\htime.c" />
+    <ClCompile Include="..\..\base\hversion.c" />
+    <ClCompile Include="..\..\base\RAII.cpp" />
+    <ClCompile Include="..\..\event\epoll.c" />
+    <ClCompile Include="..\..\event\evport.c" />
+    <ClCompile Include="..\..\event\hloop.c" />
+    <ClCompile Include="..\..\event\iocp.c" />
+    <ClCompile Include="..\..\event\kqueue.c" />
+    <ClCompile Include="..\..\event\nio.c" />
+    <ClCompile Include="..\..\event\nlog.c" />
+    <ClCompile Include="..\..\event\nmap.cpp" />
+    <ClCompile Include="..\..\event\noevent.c" />
+    <ClCompile Include="..\..\event\overlapio.c" />
+    <ClCompile Include="..\..\event\poll.c" />
+    <ClCompile Include="..\..\event\select.c" />
+    <ClCompile Include="..\..\http\client\http_client.cpp" />
+    <ClCompile Include="..\..\http\HttpParser.cpp" />
+    <ClCompile Include="..\..\http\http_content.cpp" />
+    <ClCompile Include="..\..\http\http_parser.c" />
+    <ClCompile Include="..\..\http\multipart_parser.c" />
+    <ClCompile Include="..\..\http\server\http_server.cpp" />
+    <ClCompile Include="..\..\utils\base64.c" />
+    <ClCompile Include="..\..\utils\hframe.cpp" />
+    <ClCompile Include="..\..\utils\hmain.cpp" />
+    <ClCompile Include="..\..\utils\ifconfig.cpp" />
+    <ClCompile Include="..\..\utils\iniparser.cpp" />
+    <ClCompile Include="..\..\utils\md5.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>