LCOV - code coverage report
Current view: top level - libs/http/src/server - statuses.cpp (source / functions) Coverage Total Hit
Test: coverage_filtered.info Lines: 100.0 % 18 18
Test Date: 2026-01-20 00:11:34 Functions: 100.0 % 3 3

            Line data    Source code
       1              : //
       2              : // Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com)
       3              : //
       4              : // Distributed under the Boost Software License, Version 1.0. (See accompanying
       5              : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       6              : //
       7              : // Official repository: https://github.com/cppalliance/http
       8              : //
       9              : 
      10              : #include <boost/http/server/statuses.hpp>
      11              : 
      12              : namespace boost {
      13              : namespace http {
      14              : namespace statuses {
      15              : 
      16              : bool
      17            6 : is_empty( unsigned code ) noexcept
      18              : {
      19            6 :     switch( code )
      20              :     {
      21            3 :     case 204: // No Content
      22              :     case 205: // Reset Content
      23              :     case 304: // Not Modified
      24            3 :         return true;
      25            3 :     default:
      26            3 :         return false;
      27              :     }
      28              : }
      29              : 
      30              : bool
      31            9 : is_redirect( unsigned code ) noexcept
      32              : {
      33            9 :     switch( code )
      34              :     {
      35            6 :     case 300: // Multiple Choices
      36              :     case 301: // Moved Permanently
      37              :     case 302: // Found
      38              :     case 303: // See Other
      39              :     case 305: // Use Proxy
      40              :     case 307: // Temporary Redirect
      41              :     case 308: // Permanent Redirect
      42            6 :         return true;
      43            3 :     default:
      44            3 :         return false;
      45              :     }
      46              : }
      47              : 
      48              : bool
      49            6 : is_retry( unsigned code ) noexcept
      50              : {
      51            6 :     switch( code )
      52              :     {
      53            3 :     case 502: // Bad Gateway
      54              :     case 503: // Service Unavailable
      55              :     case 504: // Gateway Timeout
      56            3 :         return true;
      57            3 :     default:
      58            3 :         return false;
      59              :     }
      60              : }
      61              : 
      62              : } // statuses
      63              : } // http
      64              : } // boost
        

Generated by: LCOV version 2.3