I wrote a simple http server using served. Found two issues.
1、Visual studio mode debugging, chrome open url http://localhost:8123/
The program will crash
Crash location: asio\include\asio\buffer.hpp
~buffer_debug_check()
{
if defined(ASIO_MSVC) && (ASIO_MSVC == 1400)
// MSVC 8's string iterator checking may crash in a std::string::iterator
// object's destructor when the iterator points to an already-destroyed
// std::string object, unless the iterator is cleared first.
Iter_ = Iterator();
endif //defined(ASIO_MSVC) && (ASIO_MSVC == 1400)
}
Void operator()()
{
(void)*iter_;
}
2、Use release to run normally, but opening the page is very slow, sometimes loading resources fails
Hello !
I wrote a simple http server using served. Found two issues.
1、Visual studio mode debugging, chrome open url http://localhost:8123/ The program will crash Crash location: asio\include\asio\buffer.hpp
~buffer_debug_check() {
if defined(ASIO_MSVC) && (ASIO_MSVC == 1400)
// MSVC 8's string iterator checking may crash in a std::string::iterator // object's destructor when the iterator points to an already-destroyed // std::string object, unless the iterator is cleared first. Iter_ = Iterator();
endif //defined(ASIO_MSVC) && (ASIO_MSVC == 1400)
}
Void operator()() { (void)*iter_; }
2、Use release to run normally, but opening the page is very slow, sometimes loading resources fails
Sample code is as follows:
`
include <served/served.hpp>
include <served/plugins.hpp>
include
include
include
include
include
inline const char * mime_type(const std::string & path) { std::string ext; size_t pos = path.rfind("."); if (pos != std::string::npos) { ext = path.substr(pos, path.size() - pos); }
}
int main(int argc, char *argv[]) { served::multiplexer mux; mux.use_after(served::plugin::access_log); std::string htdocs = argv[1];
} `