Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitigr committed Apr 18, 2022
1 parent 1816cee commit f1be9e6
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 26 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Fcgi Release Notes

## [Unreleased]

[Unreleased]: https://github.com/dmitigr/fcgi/compare/v1.0.0...HEAD
2 changes: 1 addition & 1 deletion cmake/dmitigr_fcgi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Info
# ------------------------------------------------------------------------------

dmitigr_cpplipa_set_library_info(fcgi 1 0 0 "FastCGI implementation")
dmitigr_cpplipa_set_library_info(fcgi 1 0 0 "FastCGI library")

# ------------------------------------------------------------------------------
# Sources
Expand Down
8 changes: 4 additions & 4 deletions src/fcgi/basics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct Header final {
constexpr static std::size_t max_padding_length = 255;

/// The default constructor.
Header() noexcept = default;
Header() = default;

/// Constructs by reading the header from `io`.
explicit Header(net::Descriptor* const io)
Expand Down Expand Up @@ -216,7 +216,7 @@ struct Begin_request_body final {
};

/// The default constructor.
Begin_request_body() noexcept = default;
Begin_request_body() = default;

/// Constructs by reading the record from `io`.
explicit Begin_request_body(net::Descriptor* const io)
Expand Down Expand Up @@ -249,7 +249,7 @@ struct Begin_request_body final {
/// A FastCGI end-request body.
struct End_request_body final {
/// The default constructor.
End_request_body() noexcept = default;
End_request_body() = default;

/// The constructor.
End_request_body(const int application_status,
Expand Down Expand Up @@ -358,7 +358,7 @@ class Name_value final {
class Names_values final {
public:
/// The default constructor.
Names_values() noexcept = default;
Names_values() = default;

/**
* @brief Constructs by reading the given `stream`.
Expand Down
4 changes: 2 additions & 2 deletions src/fcgi/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace dmitigr::fcgi {
class Connection {
public:
/// The destructor.
virtual ~Connection() noexcept = default;
virtual ~Connection() = default;

/// @returns The request identifier. (Always a non-zero value.)
virtual int request_id() const noexcept = 0;
Expand Down Expand Up @@ -78,7 +78,7 @@ class Connection {
private:
friend Server_connection;

Connection() noexcept = default;
Connection() = default;
};

} // namespace dmitigr::fcgi
Expand Down
2 changes: 0 additions & 2 deletions src/fcgi/listener_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class Listener_options final {
friend Listener;

net::Listener_options options_;

Listener_options() noexcept = default;
};

} // namespace dmitigr::fcgi
Expand Down
2 changes: 1 addition & 1 deletion src/fcgi/server_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Server_connection : public Connection {
private:
friend detail::iServer_connection;

Server_connection() noexcept = default;
Server_connection() = default;
};

} // namespace dmitigr::fcgi
Expand Down
2 changes: 1 addition & 1 deletion src/fcgi/streambuf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Streambuf : public std::streambuf {
private:
friend detail::iStreambuf;

Streambuf() noexcept = default;
Streambuf() = default;
};

} // namespace dmitigr::fcgi
Expand Down
4 changes: 2 additions & 2 deletions src/fcgi/streams.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace dmitigr::fcgi {
class Stream {
public:
/// The destructor.
virtual ~Stream() noexcept = default;
virtual ~Stream() = default;

/// @returns The controlled Streambuf instance.
virtual const Streambuf& streambuf() const noexcept = 0;
Expand Down Expand Up @@ -57,7 +57,7 @@ class Stream {
friend Istream;
friend Ostream;

Stream() noexcept = default;
Stream() = default;
};

/// An input data stream.
Expand Down
2 changes: 1 addition & 1 deletion src/math/interval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Interval final {
using Type = Interval_type;

/// Constructs closed [{},{}] interval.
Interval() noexcept = default;
Interval() = default;

/**
* @brief Constructs closed [min, max] interval.
Expand Down
16 changes: 4 additions & 12 deletions src/os/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,15 @@ inline std::string error_message(const int code)
if (const int e = ::strerror_s(buf, code))
throw Sys_exception{e, "cannot get an OS error message"};
else
return std::string{buf};
return buf;
#else
char buf[1024];
#if (_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE
#if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || __APPLE__
const int e = ::strerror_r(code, buf, sizeof(buf));
if (e < 0)
throw Sys_exception{e, "cannot get an OS error message"};
else if (e > 0)
return "unknown error";
else
return std::string{buf};
return !e ? buf : "unknown error";
#elif _GNU_SOURCE
const char* const msg = ::strerror_r(code, buf, sizeof(buf));
if (msg)
return msg;
else
return "unknown error";
return msg ? msg : "unknown error";
#else
#error Supported version of strerror_r() is not available.
#endif
Expand Down

0 comments on commit f1be9e6

Please sign in to comment.