瀏覽代碼

Ignore SIGPIPE

yhirose 8 年之前
父節點
當前提交
e4ef0828b0
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      httplib.h

+ 3 - 0
httplib.h

@@ -815,6 +815,9 @@ inline int SocketStream::write(const char* ptr)
 inline Server::Server()
     : svr_sock_(-1)
 {
+#ifndef _MSC_VER
+    signal(SIGPIPE, SIG_IGN);
+#endif
 }
 
 inline Server::~Server()