Commit f5e11e8e authored by Lubomir Bulej's avatar Lubomir Bulej

disl-agent: avoid name clash on dprintf().

parent 3a83cf90
......@@ -51,22 +51,15 @@
*
*/
#ifdef NDEBUG
# define dprintf(args...) do {} while (0)
# define debug(args...) do {} while (0)
#else
# define dprintf(args...) fprintf (stdout, args); fflush (stdout)
# define debug(args...) fprintf (stdout, args); fflush (stdout)
#endif
#define dlprintf(args...) { \
dprintf ("%s:%d: ", __FUNCTION__, __LINE__); \
dprintf (args); \
}
#define dlwrap(code) { \
dlprintf (""); \
code; \
dprintf ("\n"); \
#define ldebug(args...) { \
debug ("%s:%d: ", __FUNCTION__, __LINE__); \
debug (args); \
}
//
......
......@@ -73,7 +73,7 @@ void
connection_close (struct connection * connection) {
assert (connection != NULL);
dprintf (
debug (
"socket %d: sent bytes %" PRIu64 ", recv bytes %" PRIu64 "\n",
connection->sockfd, connection->sent_bytes, connection->recv_bytes
);
......
......@@ -59,14 +59,14 @@ struct connection *
connection_pool_get_connection (struct connection_pool * cp) {
assert (cp != NULL);
dlprintf ("getting connection for %s: ", cp->endpoint->ai_canonname);
ldebug ("getting connection for %s: ", cp->endpoint->ai_canonname);
//
// Grab the first available connection and return. If there is no connection
// available, create a new one and add it to the busy connection list.
//
if (!list_is_empty (&cp->free_connections)) {
dprintf ("reusing a connection [%d in total]\n", cp->connections_count);
debug ("reusing a connection [%d in total]\n", cp->connections_count);
struct list * item = list_remove_after (&cp->free_connections);
list_insert_after (item, &cp->busy_connections);
return list_item (item, struct connection, cp_link);
......@@ -80,7 +80,7 @@ connection_pool_get_connection (struct connection_pool * cp) {
list_insert_after (&connection->cp_link, &cp->busy_connections);
cp->connections_count++;
dprintf ("created new connection [%d in total]\n", cp->connections_count);
debug ("created new connection [%d in total]\n", cp->connections_count);
return connection;
}
}
......@@ -129,7 +129,7 @@ void
connection_pool_close (struct connection_pool * cp) {
assert (cp != NULL);
dlprintf (
ldebug (
"closing pool for %s: max connections %d\n",
cp->endpoint->ai_canonname, cp->connections_count
);
......
......@@ -67,7 +67,7 @@ message_send (struct connection * conn, struct message * msg) {
assert (conn != NULL);
assert (msg != NULL);
dlprintf (
ldebug (
"sending message: flags %08x, control %d, code %d ... ",
msg->message_flags, msg->control_size, msg->classcode_size
);
......@@ -85,7 +85,7 @@ message_send (struct connection * conn, struct message * msg) {
//
dprintf ("sent %ld bytes ... done\n", sent);
debug ("sent %ld bytes ... done\n", sent);
return sent;
}
......@@ -119,7 +119,7 @@ message_recv (struct connection * conn, struct message * msg) {
assert (conn != NULL);
assert (msg != NULL);
dlprintf ("receiving message: ");
ldebug ("receiving message: ");
//
// First, receive the flags, the control and class code sizes.
......@@ -151,7 +151,7 @@ message_recv (struct connection * conn, struct message * msg) {
//
dprintf (
debug (
"flags %08x, control %d, code %d ... done\n",
response_flags, control_size, classcode_size
);
......
......@@ -114,7 +114,7 @@ network_fini () {
struct connection *
network_acquire_connection () {
dlprintf ("acquiring connection ... ");
ldebug ("acquiring connection ... ");
//
// The connection pool must be protected by a lock so that multiple threads
......@@ -129,7 +129,7 @@ network_acquire_connection () {
//
dprintf ("done\n");
debug ("done\n");
return connection;
}
......@@ -140,7 +140,7 @@ network_acquire_connection () {
void
network_release_connection (struct connection * connection) {
assert (connection != NULL);
dlprintf ("releasing connection ... ");
ldebug ("releasing connection ... ");
//
// The connection pool must be protected by a lock so that multiple threads
......@@ -154,5 +154,5 @@ network_release_connection (struct connection * connection) {
//
dprintf ("done\n");
debug ("done\n");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment