mirror of
https://github.com/nginx/nginx.git
synced 2026-10-24 13:04:26 +00:00
Syslog: re-open syslog udp socket on send error (ticket #1477).
Previously, only unix domain sockets were reopened to tolerate cases when local syslog server was restarted. It makes sense to treat other cases (for example, local IP address changes) similarly.
This commit is contained in:
parent
68b50f71e1
commit
644d26e841
1 changed files with 1 additions and 5 deletions
|
|
@ -289,9 +289,7 @@ ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len)
|
|||
n = ngx_os_io.send(&peer->conn, buf, len);
|
||||
}
|
||||
|
||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||
|
||||
if (n == NGX_ERROR && peer->server.sockaddr->sa_family == AF_UNIX) {
|
||||
if (n == NGX_ERROR) {
|
||||
|
||||
if (ngx_close_socket(peer->conn.fd) == -1) {
|
||||
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
|
||||
|
|
@ -301,8 +299,6 @@ ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len)
|
|||
peer->conn.fd = (ngx_socket_t) -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue