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

Commit2b39831

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 parent8b3d528 commit2b39831

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
@@ -4113,6 +4113,14 @@ BackendInitialize(Port *port)
41134113
else
41144114
snprintf(remote_ps_data,sizeof(remote_ps_data),"%s(%s)",remote_host,remote_port);
41154115

4116+
/*
4117+
* Save remote_host and remote_port in port structure (after this, they
4118+
* will appear in log_line_prefix data for log messages).
4119+
*/
4120+
port->remote_host=strdup(remote_host);
4121+
port->remote_port=strdup(remote_port);
4122+
4123+
/* And now we can issue the Log_connections message, if wanted */
41164124
if (Log_connections)
41174125
{
41184126
if (remote_port[0])
@@ -4126,12 +4134,6 @@ BackendInitialize(Port *port)
41264134
remote_host)));
41274135
}
41284136

4129-
/*
4130-
* save remote_host and remote_port in port structure
4131-
*/
4132-
port->remote_host=strdup(remote_host);
4133-
port->remote_port=strdup(remote_port);
4134-
41354137
/*
41364138
* If we did a reverse lookup to name, we might as well save the results
41374139
* rather than possibly repeating the lookup during authentication.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp