#undef f_any
}
-int tvec_send(struct tvec_state *tv, struct tvec_reomte *r)
+int tvec_send(struct tvec_state *tv, struct tvec_remote *r)
{
kludge64 k; unsigned char lenbuf[8];
const char *p; size_t sz;
return (0);
}
-int tvec_recv(struct tvec_state *tv, struct tvec_reomte *r, buf *b_out)
+int tvec_recv(struct tvec_state *tv, struct tvec_remote *r, buf *b_out)
{
kludge64 k, szmax; unsigned char lenbuf[8];
unsigned char *p;
/*----- The output driver -------------------------------------------------*/
#define SENDPK(ro, pk) \
+ if ((ro)->r.f&TVRF_BROKEN) /* do nothing */; else \
MC_BEFORE(setpk, \
{ buf_reset(&(ro)->r.bout); \
buf_putu16l(&(ro)->r.bout.b, (pk)); }) \
{
struct remote_output *ro = (struct remote_output *)o;
- if (ro->r.f&TVRF_BROKEN) return (-1);
- dbuf_reset(&ro->r.bout);
- buf_putu16l(&ro->r.bout.b, TVPK_ERROR);
- buf_vputstrf16l(&ro->r.bout.b, msg, ap);
- return (tvec_send(ro->_o.tv, &ro->r));
+ SENDPK(ro, pk) buf_vputstrf16l(&ro->r.bout.b, msg, ap);
+ return (ro->r.f&TVRF_BROKEN ? -1 : 0);
}
-static void report(struct tvec_output *o, unsigned pk,
+static void report(struct tvec_output *o, unsigned pk, const char *what,
const char *msg, va_list *ap)
{
if (sendstr(o, pk, msg, ap)) {
- fprintf(stderr, "%s: ", QUIS);
+ fprintf(stderr, "%s %s: ", QUIS, what);
vfprintf(stderr, msg, *ap);
fputc('\n', stderr);
}
}
static void remote_error(struct tvec_output *o, const char *msg, va_list *ap)
- { report(o, TVPK_ERROR, msg, ap); }
+ { report(o, TVPK_ERROR, "ERROR", msg, ap); }
static void remote_notice(struct tvec_output *o,
const char *msg, va_list *ap)
- { report(o, TVPK_NOTICE, msg, ap); }
+ { report(o, TVPK_NOTICE, "notice", msg, ap); }
static void remote_setstatus(struct tvec_ouptut *o, int st)
{