mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-12 15:17:14 +03:00
remove log_message
This commit is contained in:
parent
4d3cc9c925
commit
66caf8a31b
6
common.c
6
common.c
@ -503,7 +503,7 @@ char* sprintaddr(char* buf, size_t size, struct addrinfo *a)
|
||||
cfg.numeric ? NI_NUMERICHOST | NI_NUMERICSERV : 0 );
|
||||
|
||||
if (res) {
|
||||
log_message(LOG_ERR, "sprintaddr:getnameinfo: %s\n", gai_strerror(res));
|
||||
print_message(msg_system_error, "sprintaddr:getnameinfo: %s\n", gai_strerror(res));
|
||||
/* Name resolution failed: do it numerically instead */
|
||||
res = getnameinfo(a->ai_addr, a->ai_addrlen,
|
||||
host, sizeof(host),
|
||||
@ -511,7 +511,7 @@ char* sprintaddr(char* buf, size_t size, struct addrinfo *a)
|
||||
NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
/* should not fail but... */
|
||||
if (res) {
|
||||
log_message(LOG_ERR, "sprintaddr:getnameinfo(NUM): %s\n", gai_strerror(res));
|
||||
print_message(msg_system_error, "sprintaddr:getnameinfo(NUM): %s\n", gai_strerror(res));
|
||||
strcpy(host, "?");
|
||||
strcpy(serv, "?");
|
||||
}
|
||||
@ -549,7 +549,7 @@ int resolve_split_name(struct addrinfo **out, char* host, char* serv)
|
||||
|
||||
res = getaddrinfo(host, serv, &hint, out);
|
||||
if (res)
|
||||
log_message(LOG_ERR, "%s `%s:%s'\n", gai_strerror(res), host, serv);
|
||||
print_message(msg_system_error, "%s `%s:%s'\n", gai_strerror(res), host, serv);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
2
common.h
2
common.h
@ -47,7 +47,7 @@
|
||||
|
||||
#define CHECK_RES_RETURN(res, str, ret) \
|
||||
if (res == -1) { \
|
||||
log_message(LOG_CRIT, "%s:%d:%s:%d:%s\n", __FILE__, __LINE__, str, errno, strerror(errno)); \
|
||||
print_message(msg_system_error, "%s:%d:%s:%d:%s\n", __FILE__, __LINE__, str, errno, strerror(errno)); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
|
20
log.c
20
log.c
@ -146,24 +146,6 @@ void setup_syslog(const char* bin_name) {
|
||||
}
|
||||
|
||||
|
||||
/* Log to syslog or stderr if foreground */
|
||||
void log_message(int type, const char* msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, msg);
|
||||
if (cfg.foreground)
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (do_syslog) {
|
||||
va_start(ap, msg);
|
||||
vsyslog(type, msg, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* syslogs who connected to where
|
||||
* desc: string description of the connection. if NULL, log_connection will
|
||||
* manage on its own
|
||||
@ -181,7 +163,7 @@ void log_connection(struct connection_desc* desc, const struct connection *cnx)
|
||||
get_connection_desc(desc, cnx);
|
||||
}
|
||||
|
||||
log_message(LOG_INFO, "%s:connection from %s to %s forwarded from %s to %s\n",
|
||||
print_message(msg_connections, "%s:connection from %s to %s forwarded from %s to %s\n",
|
||||
cnx->proto->name,
|
||||
desc->peer,
|
||||
desc->service,
|
||||
|
Loading…
x
Reference in New Issue
Block a user