Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiling gsad with libmicrohttp >= 0.9.71 #2625

Merged
merged 3 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use <predefined> to disable feed object editing and filter creation on feed status page [#2398](https://github.com/greenbone/gsa/pull/2398)

### Fixed
- Fixed compiling gsad with libmicrohttp 0.9.71 and later [#2625](https://github.com/greenbone/gsa/pull/2625)
- Fixed display of alert condition "Severity changed" [#2623](https://github.com/greenbone/gsa/pull/2623)
- Fixed sanity check for port ranges [#2566](https://github.com/greenbone/gsa/pull/2566)
- Allow to delete processes without having had edges in BPM [#2507](https://github.com/greenbone/gsa/pull/2507)
Expand Down
25 changes: 24 additions & 1 deletion gsad/src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,11 @@ exec_gmp_post (http_connection_t *con, gsad_connection_info_t *con_info,
* @param[in] name Name.
* @param[in] value Value.
*/
#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
params_mhd_add (void *params, enum MHD_ValueKind kind, const char *name,
const char *value)
{
Expand Down Expand Up @@ -2180,7 +2184,11 @@ exec_gmp_get (http_connection_t *con, gsad_connection_info_t *con_info,
*
* @return MHD_NO in case of problems. MHD_YES if all is OK.
*/
int
#if MHD_VERSION < 0x00097002
static int
#else
static enum MHD_Result
#endif
redirect_handler (void *cls, struct MHD_Connection *connection, const char *url,
const char *method, const char *version,
const char *upload_data, size_t *upload_data_size,
Expand Down Expand Up @@ -2516,9 +2524,17 @@ mhd_logger (void *arg, const char *fmt, va_list ap)

static struct MHD_Daemon *
start_unix_http_daemon (const char *unix_socket_path,
#if MHD_VERSION < 0x00097002
int handler (void *, struct MHD_Connection *,
const char *, const char *, const char *,
const char *, size_t *, void **),
#else
enum MHD_Result handler (void *,
struct MHD_Connection *,
const char *, const char *,
const char *, const char *,
size_t *, void **),
#endif
http_handler_t *http_handlers)
{
struct sockaddr_un addr;
Expand Down Expand Up @@ -2572,9 +2588,16 @@ start_unix_http_daemon (const char *unix_socket_path,

static struct MHD_Daemon *
start_http_daemon (int port,
#if MHD_VERSION < 0x00097002
int handler (void *, struct MHD_Connection *, const char *,
const char *, const char *, const char *,
size_t *, void **),
#else
enum MHD_Result handler (void *, struct MHD_Connection *,
const char *, const char *,
const char *, const char *,
size_t *, void **),
#endif
http_handler_t *http_handlers,
struct sockaddr_storage *address)
{
Expand Down
8 changes: 8 additions & 0 deletions gsad/src/gsad_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,11 @@ file_content_response (http_connection_t *connection, const char *url,
*
* @return MHD_YES.
*/
#if MHD_VERSION < 0x00097002
static int
#else
static enum MHD_Result
#endif
append_param (void *string, enum MHD_ValueKind kind, const char *key,
const char *value)
{
Expand Down Expand Up @@ -922,7 +926,11 @@ get_client_address (http_connection_t *conn, char *client_address)
*
* @return MHD_YES to continue iterating over post data, MHD_NO to stop.
*/
#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
serve_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data, uint64_t off,
Expand Down
4 changes: 4 additions & 0 deletions gsad/src/gsad_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ reconstruct_url (http_connection_t *connection, const char *url);
int
get_client_address (http_connection_t *conn, char *client_address);

#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
serve_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key,
const char *filename, const char *content_type,
const char *transfer_encoding, const char *data, uint64_t off,
Expand Down
4 changes: 4 additions & 0 deletions gsad/src/gsad_http_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,11 @@ cleanup_http_handlers ()
*
* @return MHD_NO in case of problems. MHD_YES if all is OK.
*/
#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
handle_request (void *cls, http_connection_t *connection, const char *url,
const char *method, const char *version,
const char *upload_data, size_t *upload_data_size,
Expand Down
4 changes: 4 additions & 0 deletions gsad/src/gsad_http_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ void
method_router_set_post_handler (http_handler_t *router,
http_handler_t *handler);

#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
handle_request (void *cls, http_connection_t *connection, const char *url,
const char *method, const char *version,
const char *upload_data, size_t *upload_data_size,
Expand Down
4 changes: 4 additions & 0 deletions gsad/src/gsad_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ params_append_bin (params_t *, const char *, const char *, int, int);
gboolean
params_iterator_next (params_iterator_t *, char **, param_t **);

#if MHD_VERSION < 0x00097002
int
#else
enum MHD_Result
#endif
params_mhd_add (void *params, enum MHD_ValueKind kind, const char *name,
const char *value);

Expand Down