Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb8682a7

Browse files
committed
Fix startup so that log prefix %h works for the log_connections message.
We entirely randomly chose to initialize port->remote_host just afterprinting the log_connections message, when we could perfectly well do itjust before, allowing %h and %r to work for that message. Per gripe fromArtem Tomyuk.
1 parentcc988fb commitb8682a7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,6 +4068,14 @@ BackendInitialize(Port *port)
40684068
else
40694069
snprintf(remote_ps_data,sizeof(remote_ps_data),"%s(%s)",remote_host,remote_port);
40704070

4071+
/*
4072+
* Save remote_host and remote_port in port structure (after this, they
4073+
* will appear in log_line_prefix data for log messages).
4074+
*/
4075+
port->remote_host=strdup(remote_host);
4076+
port->remote_port=strdup(remote_port);
4077+
4078+
/* And now we can issue the Log_connections message, if wanted */
40714079
if (Log_connections)
40724080
{
40734081
if (remote_port[0])
@@ -4081,12 +4089,6 @@ BackendInitialize(Port *port)
40814089
remote_host)));
40824090
}
40834091

4084-
/*
4085-
* save remote_host and remote_port in port structure
4086-
*/
4087-
port->remote_host=strdup(remote_host);
4088-
port->remote_port=strdup(remote_port);
4089-
40904092
/*
40914093
* If we did a reverse lookup to name, we might as well save the results
40924094
* rather than possibly repeating the lookup during authentication.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp