mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-09-22 04:15:55 -04:00
Feature: Added support for %R (sock_t) for debug logging
This commit is contained in:
parent
a6db913245
commit
bb12858abe
12
log/log.c
12
log/log.c
@ -51,6 +51,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "../net/sock.h"
|
||||
#include "log.h"
|
||||
|
||||
#define LOG_MAXLOGS 25
|
||||
@ -610,6 +611,17 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap)
|
||||
arg = buf;
|
||||
}
|
||||
/* fall through */
|
||||
case 'R':
|
||||
if (!arg) {
|
||||
sock_t sock = va_arg(ap, sock_t);
|
||||
if (sock == SOCK_ERROR) {
|
||||
snprintf(buf, sizeof(buf), "SOCK_ERROR");
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "%lli", (long long int)sock);
|
||||
}
|
||||
arg = buf;
|
||||
}
|
||||
/* fall through */
|
||||
case 's':
|
||||
case 'H':
|
||||
// TODO.
|
||||
|
Loading…
Reference in New Issue
Block a user