From: Stephan Bosch Date: Sun, 19 Mar 2017 14:47:41 +0000 (+0100) Subject: global: Use http_response_get_message() to log HTTP responses. X-Git-Tag: 2.2.29.rc1~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6da637fe37eb76ae2ace3a42bc0df45498ec8dce;p=thirdparty%2Fdovecot%2Fcore.git global: Use http_response_get_message() to log HTTP responses. --- diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index b7899af3a6..e2f3c93210 100755 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -340,7 +340,8 @@ void auth_policy_process_response(const struct http_response *response, if ((response->status / 10) != 20) { auth_request_log_error(context->request, "policy", - "Policy server HTTP error: %d %s", response->status, response->reason); + "Policy server HTTP error: %s", + http_response_get_message(response)); if (context->callback != NULL) context->callback(context->result, context->callback_context); return; diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index a703339ab3..92301ed0b8 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -1387,8 +1387,8 @@ http_client_connection_tunnel_response(const struct http_response *response, if (response->status != 200) { http_client_connection_failure(conn, t_strdup_printf( - "Tunnel connect(%s) failed: %d %s", name, - response->status, response->reason)); + "Tunnel connect(%s) failed: %s", name, + http_response_get_message(response))); return; } diff --git a/src/plugins/fts-solr/solr-connection.c b/src/plugins/fts-solr/solr-connection.c index c2ba2270cd..aaedd3d880 100644 --- a/src/plugins/fts-solr/solr-connection.c +++ b/src/plugins/fts-solr/solr-connection.c @@ -408,8 +408,8 @@ solr_connection_select_response(const struct http_response *response, struct solr_connection *conn) { if (response->status / 100 != 2) { - i_error("fts_solr: Lookup failed: %u %s", - response->status, response->reason); + i_error("fts_solr: Lookup failed: %s", + http_response_get_message(response)); conn->request_status = -1; return; } @@ -481,8 +481,8 @@ solr_connection_update_response(const struct http_response *response, struct solr_connection *conn) { if (response->status / 100 != 2) { - i_error("fts_solr: Indexing failed: %u %s", - response->status, response->reason); + i_error("fts_solr: Indexing failed: %s", + http_response_get_message(response)); conn->request_status = -1; } } diff --git a/src/plugins/fts/fts-parser-tika.c b/src/plugins/fts/fts-parser-tika.c index 7f9442eeae..e1888c06fe 100644 --- a/src/plugins/fts/fts-parser-tika.c +++ b/src/plugins/fts/fts-parser-tika.c @@ -97,9 +97,9 @@ fts_tika_parser_response(const struct http_response *response, case 415: /* Unsupported Media Type */ case 422: /* Unprocessable Entity */ if (parser->user->mail_debug) { - i_debug("fts_tika: PUT %s failed: %u %s", + i_debug("fts_tika: PUT %s failed: %s", mail_user_plugin_getenv(parser->user, "fts_tika"), - response->status, response->reason); + http_response_get_message(response)); } parser->payload = i_stream_create_from_data("", 0); break; @@ -114,16 +114,16 @@ fts_tika_parser_response(const struct http_response *response, isn't available anymore here. So we'd need to indicate in fts_parser_deinit() that we want to retry. FIXME: do this in v2.3. For now we'll just ignore it. */ - i_info("fts_tika: PUT %s failed: %u %s - ignoring", + i_info("fts_tika: PUT %s failed: %s - ignoring", mail_user_plugin_getenv(parser->user, "fts_tika"), - response->status, response->reason); + http_response_get_message(response)); parser->payload = i_stream_create_from_data("", 0); break; default: - i_error("fts_tika: PUT %s failed: %u %s", + i_error("fts_tika: PUT %s failed: %s", mail_user_plugin_getenv(parser->user, "fts_tika"), - response->status, response->reason); + http_response_get_message(response)); parser->failed = TRUE; break; } diff --git a/src/plugins/push-notification/push-notification-driver-ox.c b/src/plugins/push-notification/push-notification-driver-ox.c index fb152141f5..065a3af238 100644 --- a/src/plugins/push-notification/push-notification-driver-ox.c +++ b/src/plugins/push-notification/push-notification-driver-ox.c @@ -295,15 +295,15 @@ static void push_notification_driver_ox_http_callback // Success. if (user->mail_debug) { push_notification_driver_debug(OX_LOG_LABEL, user, - "Notification sent successfully: %u %s", - response->status, response->reason); + "Notification sent successfully: %s", + http_response_get_message(response)); } break; default: // Error. - i_error(OX_LOG_LABEL "Error when sending notification: %u %s", - response->status, response->reason); + i_error(OX_LOG_LABEL "Error when sending notification: %s", + http_response_get_message(response)); break; } }