Instead of using large buffers in imsgs, add the data or path onto the end.

This commit is contained in:
nicm
2019-12-16 15:48:50 +00:00
parent 21f9b39f06
commit eaa58d28dc
4 changed files with 73 additions and 52 deletions

View File

@ -2024,10 +2024,10 @@ server_client_dispatch_read_data(struct client *c, struct imsg *imsg)
struct msg_read_data *msg = imsg->data;
size_t msglen = imsg->hdr.len - IMSG_HEADER_SIZE;
struct client_file find, *cf;
void *bdata = msg->data;
size_t bsize = msg->size;
void *bdata = msg + 1;
size_t bsize = msglen - sizeof *msg;
if (msglen != sizeof *msg)
if (msglen < sizeof *msg)
fatalx("bad MSG_READ_DATA size");
find.stream = msg->stream;
if ((cf = RB_FIND(client_files, &c->files, &find)) == NULL)