Skip to content
Snippets Groups Projects
Commit e3f07ae7 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

[*] libdap-chain-crypto -> libdap-crypto

parent 639d9897
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ static void _free_user_agents_list( void ); ...@@ -117,7 +117,7 @@ static void _free_user_agents_list( void );
int dap_http_simple_module_init( ) int dap_http_simple_module_init( )
{ {
s_requests = (dap_http_simple_t *)malloc( sizeof(dap_http_simple_t *) * DAP_HTTP_SIMPLE_REQUEST_MAX * 2 ); s_requests = DAP_NEW_Z_SIZE(dap_http_simple_t*, sizeof(dap_http_simple_t *) * DAP_HTTP_SIMPLE_REQUEST_MAX * 2 );
if ( !s_requests ) { if ( !s_requests ) {
log_it( L_ERROR, "Out of memory" ); log_it( L_ERROR, "Out of memory" );
......
...@@ -102,19 +102,19 @@ typedef enum http_status_code ...@@ -102,19 +102,19 @@ typedef enum http_status_code
Http_Status_NotExtended = 510, /*!< The policy for accessing the resource has not been met in the request. [RFC 2774] */ Http_Status_NotExtended = 510, /*!< The policy for accessing the resource has not been met in the request. [RFC 2774] */
} http_status_code_t; } http_status_code_t;
static char http_status_is_informational(int code) { return (code >= 100 && code < 200); } /*!< \returns \c true if the given \p code is an informational code. */ static inline char http_status_is_informational(int code) { return (code >= 100 && code < 200); } /*!< \returns \c true if the given \p code is an informational code. */
static char http_status_is_successful(int code) { return (code >= 200 && code < 300); } /*!< \returns \c true if the given \p code is a successful code. */ static inline char http_status_is_successful(int code) { return (code >= 200 && code < 300); } /*!< \returns \c true if the given \p code is a successful code. */
static char http_status_is_redirection(int code) { return (code >= 300 && code < 400); } /*!< \returns \c true if the given \p code is a redirectional code. */ static inline char http_status_is_redirection(int code) { return (code >= 300 && code < 400); } /*!< \returns \c true if the given \p code is a redirectional code. */
static char http_status_is_client_error(int code) { return (code >= 400 && code < 500); } /*!< \returns \c true if the given \p code is a client error code. */ static inline char http_status_is_client_error(int code) { return (code >= 400 && code < 500); } /*!< \returns \c true if the given \p code is a client error code. */
static char http_status_is_serverError(int code) { return (code >= 500 && code < 600); } /*!< \returns \c true if the given \p code is a server error code. */ static inline char http_status_is_serverError(int code) { return (code >= 500 && code < 600); } /*!< \returns \c true if the given \p code is a server error code. */
static char http_status_is_error(int code) { return (code >= 400); } /*!< \returns \c true if the given \p code is any type of error code. */ static inline char http_status_is_error(int code) { return (code >= 400); } /*!< \returns \c true if the given \p code is any type of error code. */
/*! Returns the standard HTTP reason phrase for a HTTP status code. /*! Returns the standard HTTP reason phrase for a HTTP status code.
* \param code An HTTP status code. * \param code An HTTP status code.
* \return The standard HTTP reason phrase for the given \p code or \c NULL if no standard * \return The standard HTTP reason phrase for the given \p code or \c NULL if no standard
* phrase for the given \p code is known. * phrase for the given \p code is known.
*/ */
static const char* http_status_reason_phrase(unsigned short code) static inline const char* http_status_reason_phrase(unsigned short code)
{ {
switch (code) switch (code)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment