static char *uh_file_header(struct client *cl, int idx)
{
- if (!cl->data.file.hdr[idx])
+ if (!cl->dispatch.file.hdr[idx])
return NULL;
- return (char *) blobmsg_data(cl->data.file.hdr[idx]);
+ return (char *) blobmsg_data(cl->dispatch.file.hdr[idx]);
}
static void uh_file_response_ok_hdrs(struct client *cl, struct stat *s)
static void file_write_cb(struct client *cl)
{
char buf[512];
- int fd = cl->data.file.fd;
+ int fd = cl->dispatch.file.fd;
int r;
while (cl->us->w.data_bytes < 256) {
static void uh_file_free(struct client *cl)
{
- close(cl->data.file.fd);
+ close(cl->dispatch.file.fd);
}
static void uh_file_data(struct client *cl, struct path_info *pi, int fd)
return;
}
- cl->data.file.fd = fd;
- cl->dispatch_write_cb = file_write_cb;
- cl->dispatch_free = uh_file_free;
- cl->dispatch_close_fds = uh_file_free;
+ cl->dispatch.file.fd = fd;
+ cl->dispatch.write_cb = file_write_cb;
+ cl->dispatch.free = uh_file_free;
+ cl->dispatch.close_fds = uh_file_free;
file_write_cb(cl);
}
blobmsg_parse(hdr_policy, __HDR_MAX, tb, blob_data(cl->hdr.head), blob_len(cl->hdr.head));
- cl->data.file.hdr = tb;
+ cl->dispatch.file.hdr = tb;
if (!(pi->stat.st_mode & S_IROTH))
goto error;
if (!pi->redirected) {
uh_file_request(cl, pi, url);
- cl->data.file.hdr = NULL;
+ cl->dispatch.file.hdr = NULL;
}
return true;