version 1.13, 2009/08/08 21:52:43 |
version 1.14, 2009/08/11 17:18:35 |
|
|
server_write_client( |
server_write_client( |
struct client *c, enum msgtype type, const void *buf, size_t len) |
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) |
if (c->flags & CLIENT_BAD) |
return; |
return; |
log_debug("writing %d to client %d", type, c->fd); |
log_debug("writing %d to client %d", type, c->ibuf.fd); |
|
imsg_compose(ibuf, type, PROTOCOL_VERSION, -1, -1, (void *) buf, len); |
hdr.type = type; |
|
hdr.size = len; |
|
|
|
buffer_write(c->out, &hdr, sizeof hdr); |
|
if (buf != NULL && len > 0) |
|
buffer_write(c->out, buf, len); |
|
} |
} |
|
|
void |
void |