44 const auto s =
xwrite(ll->
fd, buf, len);
83 if (len > ll->
bufsz) {
151 if (strncmp(path,
"//", 2) == 0) {
157 fatalf(
"Invalid UDP logging address '%s'\n", lf->
path);
177 fatalf(
"Unable to open UDP socket for logging\n");
192 if (ENOENT == xerrno && fatal_flag) {
193 fatalf(
"Cannot open '%s' because\n"
194 "\tthe parent directory does not exist.\n"
195 "\tPlease create the directory.\n", path);
196 }
else if (EACCES == xerrno && fatal_flag) {
197 fatalf(
"Cannot open '%s' for writing.\n"
198 "\tThe parent directory must be writeable by the\n"
199 "\tuser '%s', which is the cache_effective_user\n"
static void logfile_mod_udp_writeline(Logfile *lf, const char *buf, size_t len)
static void logfile_mod_udp_rotate(Logfile *, const int16_t)
int logfile_mod_udp_open(Logfile *lf, const char *path, size_t bufsz, int fatal_flag)
static void logfile_mod_udp_linestart(Logfile *)
static void logfile_mod_udp_close(Logfile *lf)
static void logfile_mod_udp_lineend(Logfile *lf)
static void logfile_mod_udp_flush(Logfile *lf)
static void logfile_mod_udp_write(Logfile *lf, const char *buf, size_t len)
bool GetHostWithPort(char *token, Ip::Address *ipa)
void setAnyAddr()
NOTE: Does NOT clear the Port stored. Only the Address and Type.
LOGLINESTART * f_linestart
struct Logfile::@63 flags
struct SquidConfig::@90 onoff
int comm_open(int sock_type, int proto, Ip::Address &addr, int flags, const char *note)
int comm_connect_addr(int sock, const Ip::Address &address)
#define debugs(SECTION, LEVEL, CONTENT)
void fatalf(const char *fmt,...)
void fd_bytes(const int fd, const int len, const IoDirection direction)
int xwrite(int fd, const void *buf, size_t bufSize)
POSIX write(2) equivalent.
void * xcalloc(size_t n, size_t sz)
const char * xstrerr(int error)