You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2020/10/19 20:45:38 UTC
[qpid-dispatch] branch dev-protocol-adaptors-2 updated: NO-JIRA:
more coverity error cleanups
This is an automated email from the ASF dual-hosted git repository.
kgiusti pushed a commit to branch dev-protocol-adaptors-2
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/dev-protocol-adaptors-2 by this push:
new 128469e NO-JIRA: more coverity error cleanups
128469e is described below
commit 128469e53f7b46bcdc6fac03aa87e59256e0e3a6
Author: Kenneth Giusti <kg...@apache.org>
AuthorDate: Mon Oct 19 16:45:02 2020 -0400
NO-JIRA: more coverity error cleanups
---
src/adaptors/http1/http1_server.c | 16 ++++++++--------
src/message.c | 2 ++
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/adaptors/http1/http1_server.c b/src/adaptors/http1/http1_server.c
index c58ba1b..9d9cbf5 100644
--- a/src/adaptors/http1/http1_server.c
+++ b/src/adaptors/http1/http1_server.c
@@ -190,7 +190,7 @@ static qdr_http1_connection_t *_create_server_connection(qd_http_connector_t *ct
0); // bind token
qdr_connection_set_context(hconn->qdr_conn, hconn);
- qd_log(hconn->adaptor->log, QD_LOG_DEBUG, "[C%i] HTTP connection to server created", hconn->conn_id);
+ qd_log(hconn->adaptor->log, QD_LOG_DEBUG, "[C%"PRIu64"] HTTP connection to server created", hconn->conn_id);
// wait for the raw connection to come up before creating the in and out links
@@ -420,7 +420,7 @@ static void _handle_connection_events(pn_event_t *e, qd_server_t *qd_server, voi
}
// fall through
case PN_RAW_CONNECTION_CLOSED_WRITE: {
- qd_log(log, QD_LOG_DEBUG, "[C%i] Closed for %s", hconn->conn_id,
+ qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] Closed for %s", hconn->conn_id,
pn_event_type(e) == PN_RAW_CONNECTION_CLOSED_READ
? "reading" : "writing");
pn_raw_connection_close(hconn->raw_conn);
@@ -433,7 +433,7 @@ static void _handle_connection_events(pn_event_t *e, qd_server_t *qd_server, voi
if (!hconn->qdr_conn) {
// the router has closed this connection so do not try to
// re-establish it
- qd_log(log, QD_LOG_INFO, "[C%i] Connection closed", hconn->conn_id);
+ qd_log(log, QD_LOG_INFO, "[C%"PRIu64"] Connection closed", hconn->conn_id);
hconn->raw_conn = 0;
qdr_http1_connection_free(hconn);
return;
@@ -459,7 +459,7 @@ static void _handle_connection_events(pn_event_t *e, qd_server_t *qd_server, voi
//
qd_duration_t nap_time = RETRY_PAUSE_MSEC * hconn->server.reconnect_count;
if (hconn->server.reconnect_count == MAX_RECONNECT) {
- qd_log(log, QD_LOG_INFO, "[C%i] Server not responding - disconnecting...", hconn->conn_id);
+ qd_log(log, QD_LOG_INFO, "[C%"PRIu64"] Server not responding - disconnecting...", hconn->conn_id);
_teardown_server_links(hconn);
} else {
hconn->server.reconnect_count += 1; // increase next sleep interval
@@ -473,7 +473,7 @@ static void _handle_connection_events(pn_event_t *e, qd_server_t *qd_server, voi
break;
}
case PN_RAW_CONNECTION_NEED_READ_BUFFERS: {
- qd_log(log, QD_LOG_DEBUG, "[C%i] Need read buffers", hconn->conn_id);
+ qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] Need read buffers", hconn->conn_id);
// @TODO(kgiusti): backpressure if no credit
// if (hconn->in_link_credit > 0 */)
if (!hconn->close_connection) {
@@ -484,9 +484,9 @@ static void _handle_connection_events(pn_event_t *e, qd_server_t *qd_server, voi
break;
}
case PN_RAW_CONNECTION_WAKE: {
- qd_log(log, QD_LOG_DEBUG, "[C%i] Wake-up", hconn->conn_id);
+ qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] Wake-up", hconn->conn_id);
while (qdr_connection_process(hconn->qdr_conn)) {}
- qd_log(log, QD_LOG_DEBUG, "[C%i] Connection processing complete", hconn->conn_id);
+ qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] Connection processing complete", hconn->conn_id);
break;
}
case PN_RAW_CONNECTION_READ: {
@@ -1400,7 +1400,7 @@ static void _write_pending_request(_server_request_t *hreq)
assert(DEQ_PREV(&hreq->base) == 0); // preserve order!
uint64_t written = qdr_http1_write_out_data(hreq->base.hconn, &hreq->out_data);
hreq->base.out_http1_octets += written;
- qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, "[C%i] %"PRIu64" octets written",
+ qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, "[C%"PRIu64"] %"PRIu64" octets written",
hreq->base.hconn->conn_id, written);
}
}
diff --git a/src/message.c b/src/message.c
index 9d3c5c5..9f60d1f 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2351,6 +2351,7 @@ void trim_body_data_headers(qd_message_body_data_t *body_data)
if (good) {
unsigned char tag = 0;
size_t vbin_hdr_len = 1;
+ // coverity[check_return]
next_octet(&cursor, &buffer, &tag);
if (tag == QD_AMQP_VBIN8) {
advance(&cursor, &buffer, 1);
@@ -2360,6 +2361,7 @@ void trim_body_data_headers(qd_message_body_data_t *body_data)
vbin_hdr_len += 4;
}
+ // coverity[check_return]
can_advance(&cursor, &buffer); // bump cursor to the next buffer if necessary
body_data->payload.buffer = buffer;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org