Skip to content

Commit

Permalink
Adjusted the source code formatting.
Browse files Browse the repository at this point in the history
Adjusted the source code formatting for "gsad_gmp.c",
"gsad_gmp.h" and "gsad_http_handler.c".
  • Loading branch information
jhelmold committed Sep 8, 2021
1 parent a6b9c3f commit b8f3832
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
32 changes: 15 additions & 17 deletions gsad/src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10165,9 +10165,8 @@ get_system_reports_gmp (gvm_connection_t *connection,
* @return Enveloped XML object.
*/
char *
get_system_report_gmp (gvm_connection_t *connection,
credentials_t *credentials, params_t *params,
cmd_response_data_t *response_data)
get_system_report_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
GString *xml;

Expand Down Expand Up @@ -10210,10 +10209,7 @@ get_system_report_gmp (gvm_connection_t *connection,
slave_id ? slave_id : "0");
}

if (gvm_connection_sendf (connection,
"%s",
gmp_command)
== -1)
if (gvm_connection_sendf (connection, "%s", gmp_command) == -1)
{
g_string_free (xml, TRUE);
g_free (gmp_command);
Expand Down Expand Up @@ -10262,8 +10258,9 @@ get_system_report_gmp (gvm_connection_t *connection,
* @return Image, or NULL.
*/
char *
get_system_report_gmp_from_url (gvm_connection_t *connection, credentials_t *credentials,
const char *url, params_t *params,
get_system_report_gmp_from_url (gvm_connection_t *connection,
credentials_t *credentials, const char *url,
params_t *params,
cmd_response_data_t *response_data)
{
entity_t entity;
Expand Down Expand Up @@ -10348,18 +10345,19 @@ get_system_report_gmp_from_url (gvm_connection_t *connection, credentials_t *cre
content = (char *) g_base64_decode (content_64, &content_length);

#if 1
if (strcmp(entity_attribute (report_entity, "format"), "png") == 0)
if (strcmp (entity_attribute (report_entity, "format"), "png")
== 0)
{
cmd_response_data_set_content_type (response_data,
GSAD_CONTENT_TYPE_IMAGE_PNG);
cmd_response_data_set_content_type (
response_data, GSAD_CONTENT_TYPE_IMAGE_PNG);
}
else
else
{
cmd_response_data_set_content_type (response_data,
GSAD_CONTENT_TYPE_TEXT_PLAIN);
cmd_response_data_set_content_type (
response_data, GSAD_CONTENT_TYPE_TEXT_PLAIN);
}
//*content_disposition = g_strdup_printf ("attachment;
// filename=\"xxx.png\"");
//*content_disposition = g_strdup_printf ("attachment;
// filename=\"xxx.png\"");
#else
g_free (content);
content = g_strdup ("helo");
Expand Down
5 changes: 3 additions & 2 deletions gsad/src/gsad_gmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,9 @@ char *
get_system_report_gmp (gvm_connection_t *, credentials_t *, params_t *,
cmd_response_data_t *);
char *
get_system_report_gmp_from_url (gvm_connection_t *, credentials_t *, const char *,
params_t *, cmd_response_data_t *);
get_system_report_gmp_from_url (gvm_connection_t *, credentials_t *,
const char *, params_t *,
cmd_response_data_t *);

char *
get_report_format_gmp (gvm_connection_t *, credentials_t *, params_t *,
Expand Down
6 changes: 3 additions & 3 deletions gsad/src/gsad_http_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,9 @@ handle_system_report (http_connection_t *connection, const char *method,
switch (manager_connect (credentials, &con, response_data))
{
case 0: /* success */
res = get_system_report_gmp_from_url (&con, credentials,
&url[0] + strlen ("/system_report/"), params,
response_data);
res = get_system_report_gmp_from_url (
&con, credentials, &url[0] + strlen ("/system_report/"), params,
response_data);
gvm_connection_close (&con);
break;
case 1: /* manager closed connection */
Expand Down

0 comments on commit b8f3832

Please sign in to comment.