26 "bad-namespace-prefix",
31 "improper-addressing",
32 "internal-server-error",
39 "remote-connection-failed",
41 "resource-constraint",
44 "undefined-condition",
45 "unsupported-encoding",
46 "unsupported-stanza-type",
47 "unsupported-version",
48 "xml-not-well-formed",
60 if(text != NULL) len += strlen(
uri_STREAM_ERR) + strlen(text) + 22;
66 len = sprintf(buf->
data,
"<stream:stream xmlns:stream='" uri_STREAMS "' version='1.0'>");
71 len += sprintf(&(buf->
data[len]),
"<stream:error xmlns:stream='" uri_STREAMS "'><%s xmlns='" uri_STREAM_ERR
"'/><text xmlns='" uri_STREAM_ERR
"'>%s</text></stream:error>",
_stream_errors[err], text);
74 len += sprintf(&(buf->
data[len]),
"</stream:stream>");
77 assert(len == buf->
len);
106 if(content != NULL) len += strlen(content) + strlen(
_stream_errors[err]) + 2;
112 len = sprintf(buf->
data,
"<stream:stream xmlns:stream='" uri_STREAMS "' version='1.0'>");
120 len += sprintf(&(buf->
data[len]),
"</stream:stream>");
123 assert(len == buf->
len);
#define _sx_event(s, e, data)
void _sx_error_extended(sx_t s, int err, const char *content)
static const char * _stream_errors[]
if you change these, reflect your changes in the defines in sx.h
holds the state for a single stream
void jqueue_push(jqueue_t q, void *data, int priority)
sx_buf_t _sx_buffer_new(const char *data, int len, _sx_notify_t notify, void *notify_arg)
utility: make a new buffer if len>0 but data is NULL, the buffer will contain that many bytes of garb...
void sx_error_extended(sx_t s, int err, const char *content)
void sx_error(sx_t s, int err, const char *text)
void _sx_error(sx_t s, int err, const char *text)
send an error