Pārlūkot izejas kodu

* Some small improvements

master
bergmann pirms 6 gadiem
vecāks
revīzija
12d65ad6be
3 mainītis faili ar 11 papildinājumiem un 11 dzēšanām
  1. +3
    -3
      include/cppmicrohttpd/daemon.h
  2. +3
    -3
      include/cppmicrohttpd/daemon.inl
  3. +5
    -5
      src/cppmicrohttpd/damon.cpp

+ 3
- 3
include/cppmicrohttpd/daemon.h Parādīt failu

@@ -79,9 +79,9 @@ namespace cppmicrohttpd
/**
* @brief Get the timeout in milliseconds to wait for the file descriptors.
*
* @return Timeout how many milliseconds select should at most block.
* @return Timeout how many milliseconds select should at most block (0r -1 if not relevant).
*/
inline unsigned long long get_timeout() const;
inline long long get_timeout() const;

protected:
/**
@@ -108,7 +108,7 @@ namespace cppmicrohttpd
* @return The created response.
*/
virtual response_ptr_u create_response(
const request& p_request);
request& p_request);

/**
* @brief Create a default response object.


+ 3
- 3
include/cppmicrohttpd/daemon.inl Parādīt failu

@@ -36,12 +36,12 @@ namespace cppmicrohttpd
return ret;
}

unsigned long long daemon::get_timeout() const
long long daemon::get_timeout() const
{
unsigned long long timeout = 0;
if (MHD_get_timeout(_handle.get(), &timeout) != MHD_YES)
throw exception("Unable to execute MHD_get_timeout");
return timeout;
return -1;
return static_cast<long long>(timeout);
}

}

+ 5
- 5
src/cppmicrohttpd/damon.cpp Parādīt failu

@@ -38,7 +38,7 @@ request_ptr_u daemon::create_request(
{ return std::make_unique<request>(p_connection, p_url, p_method, p_version); }

response_ptr_u daemon::create_response(
const request& p_request)
request& p_request)
{ return create_default_response(p_request, true); }

response_ptr_u daemon::create_default_response(
@@ -144,28 +144,28 @@ int daemon::mhd_access_handler_callback(
{
cppmicrohttpd_log(warn) << "Error while handling post data: " << ex;
req.set_error(ex);
*data_size = 0; // Assume that all data has been progressed
*data_size = 0; // Assume that all data has been processed
return MHD_YES;
}
catch(const exception& ex)
{
cppmicrohttpd_log(warn) << "Error while handling post data: " << ex;
req.set_error(ex);
*data_size = 0; // Assume that all data has been progressed
*data_size = 0; // Assume that all data has been processed
return MHD_YES;
}
catch(std::exception& ex)
{
cppmicrohttpd_log(warn) << "Error while handling post data: " << ex.what();
req.set_error(exception(ex.what()));
*data_size = 0; // Assume that all data has been progressed
*data_size = 0; // Assume that all data has been processed
return MHD_YES;
}
catch(...)
{
cppmicrohttpd_log(warn) << "Error while handling post data: unknown";
req.set_error(exception("Unknown error"));
*data_size = 0; // Assume that all data has been progressed
*data_size = 0; // Assume that all data has been processed
return MHD_YES;
}



Notiek ielāde…
Atcelt
Saglabāt