diff --git a/websocketpp/processors/hybi00.hpp b/websocketpp/processors/hybi00.hpp index 79708011b6..1bd996a93d 100644 --- a/websocketpp/processors/hybi00.hpp +++ b/websocketpp/processors/hybi00.hpp @@ -28,6 +28,8 @@ #ifndef WEBSOCKETPP_PROCESSOR_HYBI00_HPP #define WEBSOCKETPP_PROCESSOR_HYBI00_HPP +#include + // For htonl #if defined(WIN32) #include @@ -109,7 +111,7 @@ public: std::copy(key3.c_str(), key3.c_str()+std::min(static_cast(8), key3.size()), &key_final[8]); - + res.append_header( "Sec-WebSocket-Key3", md5::md5_hash_string(std::string(key_final,16)) @@ -242,7 +244,7 @@ private: } } - num = atoi(digits.c_str()); + num = strtoul(digits.c_str(), NULL, 10); if (spaces > 0 && num > 0) { num = htonl(num/spaces); std::copy(reinterpret_cast(&num),