diff --git a/ixwebsocket/IXSetThreadName.cpp b/ixwebsocket/IXSetThreadName.cpp deleted file mode 100644 index 5147c14c..00000000 --- a/ixwebsocket/IXSetThreadName.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * IXSetThreadName.cpp - * Author: Benjamin Sergeant - * Copyright (c) 2018 Machine Zone, Inc. All rights reserved. - */ -#include "IXSetThreadName.h" -#include - -namespace ix -{ - void setThreadName(const std::string& name) - { -#if defined(__linux__) - // - // Linux only reserve 16 bytes for its thread names - // See prctl and PR_SET_NAME property in - // http://man7.org/linux/man-pages/man2/prctl.2.html - // - pthread_setname_np(pthread_self(), - name.substr(0, 15).c_str()); -#elif defined(__APPLE__) - // - // Apple is more generous with 64 chars. - // notice how the Apple version does not take a pthread_t argument - // - pthread_setname_np(name.substr(0, 63).c_str()); -#elif - #error("Unsupported platform"); -#endif - } -} diff --git a/ixwebsocket/IXWebSocketHandshake.cpp b/ixwebsocket/IXWebSocketHandshake.cpp index 4dedff92..9d9c81d7 100644 --- a/ixwebsocket/IXWebSocketHandshake.cpp +++ b/ixwebsocket/IXWebSocketHandshake.cpp @@ -116,7 +116,7 @@ namespace ix std::cout << "-------------------------------" << std::endl; } - std::string trim(const std::string& str) + std::string WebSocketHandshake::trim(const std::string& str) { std::string out(str); out.erase(std::remove(out.begin(), out.end(), ' '), out.end()); diff --git a/ixwebsocket/IXWebSocketHandshake.h b/ixwebsocket/IXWebSocketHandshake.h index eeafcc6c..779f56d3 100644 --- a/ixwebsocket/IXWebSocketHandshake.h +++ b/ixwebsocket/IXWebSocketHandshake.h @@ -75,6 +75,7 @@ namespace ix WebSocketInitResult sendErrorResponse(int code, const std::string& reason); std::tuple parseRequestLine(const std::string& line); + std::string trim(const std::string& str); std::atomic& _requestInitCancellation; std::shared_ptr _socket;