summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
Diffstat (limited to 'server-fn.c')
-rw-r--r--server-fn.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/server-fn.c b/server-fn.c
index 6f6ed2c8..8d5d06bd 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -55,18 +55,12 @@ void
server_write_client(
struct client *c, enum msgtype type, const void *buf, size_t len)
{
- struct hdr hdr;
+ struct imsgbuf *ibuf = &c->ibuf;
if (c->flags & CLIENT_BAD)
return;
- log_debug("writing %d to client %d", type, c->fd);
-
- hdr.type = type;
- hdr.size = len;
-
- buffer_write(c->out, &hdr, sizeof hdr);
- if (buf != NULL && len > 0)
- buffer_write(c->out, buf, len);
+ log_debug("writing %d to client %d", type, c->ibuf.fd);
+ imsg_compose(ibuf, type, PROTOCOL_VERSION, -1, -1, (void *) buf, len);
}
void