Service.set_error_handler is triggered twice after a successful call
I have a service and i've setup an error handler to log errors.
I have the Settings.set_keep_alive( false ) setup as well
When I call a route and it completes successfully, the service error handler will be called twice anyways. session->close(OK, body, headers);
Errors are : Client has timed out and connection was closed on the local system
Seems like it expects the connection to be kept alive even if I used set_keep_alive( false )?
We saw a similar issue in the past, perhaps a regression has crept back in. We will drill down further.
I was wondering also if there is a way to use std::wstring for the Logger.log( Level, std::string ) function. This would help with internationalization.
Thanks!
Mixed encodings is a slippery slope, we don't favour implementing this in Restbed.
You can achieve your goal as follows:
#include <locale>
#include <codecvt>
#include <string>
using namespace std;
wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
wstring ex1 = converter.from_bytes(utf8_source_string);
string ex2 = converter.to_bytes(utf16_source_string);