#endif
#ifndef WG_DEFAULT_PROTOCOL
-# define WG_DEFAULT_PROTOCOL "udp"
+# define WG_DEFAULT_PROTOCOL "tcp"
#endif
#ifndef WG_DEFAULT_LOG_SEND_ERRORS
status = swrite (cb->sock_fd, cb->send_buf, strlen (cb->send_buf));
if (status < 0)
{
+ const char *protocol = cb->protocol ? cb->protocol : WG_DEFAULT_PROTOCOL;
+
if (cb->log_send_errors)
{
char errbuf[1024];
ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)",
- cb->node, cb->service, cb->protocol,
+ cb->node, cb->service, protocol,
status, sstrerror (errno, errbuf, sizeof (errbuf)));
}