Skip to content

Commit 81e8ae2

Browse files
committed
Log underlying connection protocol
1 parent 465444d commit 81e8ae2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/netlog/netlog-network.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void manager_close_network_socket(Manager *m) {
139139
int manager_network_connect_socket(Manager *m) {
140140
_cleanup_free_ char *pretty = NULL;
141141
union sockaddr_union sa;
142+
const char *protocol;
142143
socklen_t salen;
143144
int r;
144145

@@ -170,16 +171,18 @@ int manager_network_connect_socket(Manager *m) {
170171
if (r < 0)
171172
return r;
172173

173-
log_debug("Connecting to remote server: '%s'", pretty);
174+
protocol = protocol_to_string(m->protocol);
175+
176+
log_debug("Connecting to remote server: '%s/%s'", pretty, protocol);
174177

175178
r = connect(m->socket, &m->address.sockaddr.sa, salen);
176179
if (r < 0 && errno != EINPROGRESS)
177-
return log_error_errno(errno, "Failed to connect to remote server='%s': %m", pretty);
180+
return log_error_errno(errno, "Failed to connect to remote server='%s/%s': %m", pretty, protocol);
178181

179182
if (errno != EINPROGRESS)
180-
log_debug("Connected to remote server: '%s'", pretty);
183+
log_debug("Connected to remote server: '%s/%s'", pretty, protocol);
181184
else
182-
log_debug("Connection in progress to remote server: '%s'", pretty);
185+
log_debug("Connection in progress to remote server: '%s/%s'", pretty, protocol);
183186

184187
return 0;
185188
}

0 commit comments

Comments
 (0)