mirror of
https://github.com/darkk/redsocks.git
synced 2025-08-30 05:35:30 +00:00
Another source code cleanup.
This commit is contained in:
parent
8ad8d7eb41
commit
6e574a2021
@ -373,14 +373,9 @@ static void redsocks_event_error(struct bufferevent *buffev, short what, void *_
|
||||
}
|
||||
else {
|
||||
errno = redsocks_socket_geterrno(client, buffev);
|
||||
redsocks_log_errno(client, LOG_NOTICE, "%s error, code %s|%s|%s|%s|%s == %X",
|
||||
redsocks_log_errno(client, LOG_NOTICE, "%s error, code " event_fmt_str,
|
||||
buffev == client->relay ? "relay" : "client",
|
||||
what & EVBUFFER_READ ? "EVBUFFER_READ" : "0",
|
||||
what & EVBUFFER_WRITE ? "EVBUFFER_WRITE" : "0",
|
||||
what & EVBUFFER_EOF ? "EVBUFFER_EOF" : "0",
|
||||
what & EVBUFFER_ERROR ? "EVBUFFER_ERROR" : "0",
|
||||
what & EVBUFFER_TIMEOUT ? "EVBUFFER_TIMEOUT" : "0",
|
||||
what);
|
||||
event_fmt(what));
|
||||
redsocks_drop_client(client);
|
||||
}
|
||||
}
|
||||
|
9
utils.h
9
utils.h
@ -30,6 +30,15 @@ int red_is_socket_connected_ok(struct bufferevent *buffev);
|
||||
|
||||
int fcntl_nonblock(int fd);
|
||||
|
||||
#define event_fmt_str "%s|%s|%s|%s|%s|0x%x"
|
||||
#define event_fmt(what) \
|
||||
(what) & EVBUFFER_READ ? "EVBUFFER_READ" : "0", \
|
||||
(what) & EVBUFFER_WRITE ? "EVBUFFER_WRITE" : "0", \
|
||||
(what) & EVBUFFER_EOF ? "EVBUFFER_EOF" : "0", \
|
||||
(what) & EVBUFFER_ERROR ? "EVBUFFER_ERROR" : "0", \
|
||||
(what) & EVBUFFER_TIMEOUT ? "EVBUFFER_TIMEOUT" : "0", \
|
||||
(what) & ~(EVBUFFER_READ|EVBUFFER_WRITE|EVBUFFER_EOF|EVBUFFER_ERROR|EVBUFFER_TIMEOUT)
|
||||
|
||||
/* vim:set tabstop=4 softtabstop=4 shiftwidth=4: */
|
||||
/* vim:set foldmethod=marker foldlevel=32 foldmarker={,}: */
|
||||
#endif /* UTILS_H_SAT_FEB__2_02_24_05_2008 */
|
||||
|
Loading…
Reference in New Issue
Block a user