Latest update - 7278

This commit is contained in:
2018-05-23 23:56:08 +09:00
parent fe81cd69c7
commit f94531f1ea
3 changed files with 16 additions and 21 deletions
+16 -16
View File
@@ -39,7 +39,8 @@ static ngx_event_t ngx_syslog_dummy_event;
char *
ngx_syslog_process_conf(ngx_conf_t *cf, ngx_syslog_peer_t *peer)
{
peer->pool = cf->pool;
ngx_pool_cleanup_t *cln;
peer->facility = NGX_CONF_UNSET_UINT;
peer->severity = NGX_CONF_UNSET_UINT;
@@ -67,6 +68,19 @@ ngx_syslog_process_conf(ngx_conf_t *cf, ngx_syslog_peer_t *peer)
peer->conn.fd = (ngx_socket_t) -1;
peer->conn.read = &ngx_syslog_dummy_event;
peer->conn.write = &ngx_syslog_dummy_event;
ngx_syslog_dummy_event.log = &ngx_syslog_dummy_log;
cln = ngx_pool_cleanup_add(cf->pool, 0);
if (cln == NULL) {
return NGX_CONF_ERROR;
}
cln->data = peer;
cln->handler = ngx_syslog_cleanup;
return NGX_CONF_OK;
}
@@ -306,13 +320,7 @@ ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len)
static ngx_int_t
ngx_syslog_init_peer(ngx_syslog_peer_t *peer)
{
ngx_socket_t fd;
ngx_pool_cleanup_t *cln;
peer->conn.read = &ngx_syslog_dummy_event;
peer->conn.write = &ngx_syslog_dummy_event;
ngx_syslog_dummy_event.log = &ngx_syslog_dummy_log;
ngx_socket_t fd;
fd = ngx_socket(peer->server.sockaddr->sa_family, SOCK_DGRAM, 0);
if (fd == (ngx_socket_t) -1) {
@@ -333,14 +341,6 @@ ngx_syslog_init_peer(ngx_syslog_peer_t *peer)
goto failed;
}
cln = ngx_pool_cleanup_add(peer->pool, 0);
if (cln == NULL) {
goto failed;
}
cln->data = peer;
cln->handler = ngx_syslog_cleanup;
peer->conn.fd = fd;
/* UDP sockets are always ready to write */
-1
View File
@@ -9,7 +9,6 @@
typedef struct {
ngx_pool_t *pool;
ngx_uint_t facility;
ngx_uint_t severity;
ngx_str_t tag;
-4
View File
@@ -21,10 +21,6 @@ ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
struct crypt_data cd;
cd.initialized = 0;
#ifdef __GLIBC__
/* work around the glibc bug */
cd.current_salt[0] = ~salt[0];
#endif
value = crypt_r((char *) key, (char *) salt, &cd);