log/m_log_tcp_syslog.c
/* Add octet-counting framing and syslog header to given message, then add result to given buf. */
Add octet-counting framing and syslog header to given message, then add result to given buf.
Add octet - counting framing and syslog header to given message then add result to given buf .
static void add_framed_message(M_buf_t *buf, const char *msg, module_thunk_t *mdata, M_syslog_priority_t priority)
{
	M_buf_t *payload;
	payload = M_buf_create();
	add_syslog_header(payload, mdata, priority);
	M_buf_add_str_replace(payload, msg, "\t", M_SYSLOG_TAB_REPLACE);
	if (M_buf_len(payload) > M_SYSLOG_MAX_CHARS) {
		M_buf_truncate(payload, M_SYSLOG_MAX_CHARS - M_str_len(mdata->line_end_str));
		M_buf_add_str(payload, mdata->line_end_str);
	}
	M_buf_add_uint(buf, M_buf_len(payload)); 
	M_buf_add_byte(buf, ' ');
	M_buf_merge(buf, payload); 
}
static void add_framed_message ( M_buf_t * buf , const char * msg , module_thunk_t * mdata , M_syslog_priority_t priority ) { M_buf_t * payload ; payload = M_buf_create ( ) ; add_syslog_header ( payload , mdata , priority ) ; M_buf_add_str_replace ( payload , msg , " \t " , M_SYSLOG_TAB_REPLACE ) ; if ( M_buf_len ( payload ) > M_SYSLOG_MAX_CHARS ) { M_buf_truncate ( payload , M_SYSLOG_MAX_CHARS - M_str_len ( mdata -> line_end_str ) ) ; M_buf_add_str ( payload , mdata -> line_end_str ) ; } M_buf_add_uint ( buf , M_buf_len ( payload ) ) ; M_buf_add_byte ( buf , ' ' ) ; M_buf_merge ( buf , payload ) ; }
Add octet-counting framing and syslog header to given message, then add result to given buf.
Add octet - counting framing and syslog header to given message then add result to given buf .
/* Add bytes from msg to payload, replace tabs while we do so. */ /* Truncate payload if message greater than syslog limit. Make sure we still end with the line ending sequence. */ /* Add octet-counting framing around message (see RFC 6587). */ /* number of bytes in payload */ /* merge payload onto end of buf (destroys payload) */