Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
DiSL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DiSL
DiSL
Commits
f5e11e8e
Commit
f5e11e8e
authored
Dec 19, 2016
by
Lubomir Bulej
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disl-agent: avoid name clash on dprintf().
parent
3a83cf90
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
25 deletions
+18
-25
src-disl-agent/common.h
src-disl-agent/common.h
+5
-12
src-disl-agent/connection.c
src-disl-agent/connection.c
+1
-1
src-disl-agent/connpool.c
src-disl-agent/connpool.c
+4
-4
src-disl-agent/msgchannel.c
src-disl-agent/msgchannel.c
+4
-4
src-disl-agent/network.c
src-disl-agent/network.c
+4
-4
No files found.
src-disl-agent/common.h
View file @
f5e11e8e
...
...
@@ -51,22 +51,15 @@
*
*/
#ifdef NDEBUG
# define d
printf
(args...) do {} while (0)
# define d
ebug
(args...) do {} while (0)
#else
# define d
printf
(args...) fprintf (stdout, args); fflush (stdout)
# define d
ebug
(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); \
}
//
...
...
src-disl-agent/connection.c
View file @
f5e11e8e
...
...
@@ -73,7 +73,7 @@ void
connection_close
(
struct
connection
*
connection
)
{
assert
(
connection
!=
NULL
);
d
printf
(
d
ebug
(
"socket %d: sent bytes %"
PRIu64
", recv bytes %"
PRIu64
"
\n
"
,
connection
->
sockfd
,
connection
->
sent_bytes
,
connection
->
recv_bytes
);
...
...
src-disl-agent/connpool.c
View file @
f5e11e8e
...
...
@@ -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
))
{
d
printf
(
"reusing a connection [%d in total]
\n
"
,
cp
->
connections_count
);
d
ebug
(
"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
++
;
d
printf
(
"created new connection [%d in total]
\n
"
,
cp
->
connections_count
);
d
ebug
(
"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
);
...
...
src-disl-agent/msgchannel.c
View file @
f5e11e8e
...
...
@@ -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) {
//
d
printf
(
"sent %ld bytes ... done
\n
"
,
sent
);
d
ebug
(
"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) {
//
d
printf
(
d
ebug
(
"flags %08x, control %d, code %d ... done
\n
"
,
response_flags
,
control_size
,
classcode_size
);
...
...
src-disl-agent/network.c
View file @
f5e11e8e
...
...
@@ -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 () {
//
d
printf
(
"done
\n
"
);
d
ebug
(
"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) {
//
d
printf
(
"done
\n
"
);
d
ebug
(
"done
\n
"
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment