summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-04 02:30:59 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-04 02:30:59 +0100
commite446c68fb59eb6b413fdb6a3043b38fbfa2f8a43 (patch)
tree910f4cdef11267f718ab7eedaadb2a7be048be0f /proc.c
parent27e60fb7bbea043a4d5972a05bda1146fac84da0 (diff)
re-enable reads from the cgi pipe after enough data has been written to the client
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index e37176d..097a719 100644
--- a/proc.c
+++ b/proc.c
@@ -245,6 +245,16 @@ static void proc_write_cb(struct uloop_fd *fd, unsigned int events)
client_poll_post_data(cl);
}
+static void proc_relay_write_cb(struct client *cl)
+{
+ struct dispatch_proc *p = &cl->dispatch.proc;
+
+ if (ustream_pending_data(cl->us, true))
+ return;
+
+ ustream_set_read_blocked(&p->r.sfd.stream, false);
+}
+
static int proc_data_send(struct client *cl, const char *data, int len)
{
struct dispatch_proc *p = &cl->dispatch.proc;
@@ -331,6 +341,7 @@ bool uh_create_process(struct client *cl, struct path_info *pi,
d->close_fds = proc_close_fds;
d->data_send = proc_data_send;
d->data_done = proc_write_close;
+ d->write_cb = proc_relay_write_cb;
proc->r.header_cb = proc_handle_header;
proc->r.header_end = proc_handle_header_end;
proc->r.close = proc_handle_close;