From ef10dc054ff44dca6c0f4015ffab4eb8ec5088d1 Mon Sep 17 00:00:00 2001 From: Roberto De Ioris Date: Sat, 20 Oct 2012 17:55:04 +0200 Subject: [PATCH] fixed fastrouter --- plugins/corerouter/corerouter.c | 3 +++ plugins/fastrouter/fastrouter.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/corerouter/corerouter.c b/plugins/corerouter/corerouter.c index 78a04446..676e6dfc 100644 --- a/plugins/corerouter/corerouter.c +++ b/plugins/corerouter/corerouter.c @@ -804,6 +804,9 @@ void uwsgi_corerouter_loop(int id, void *data) { // on error, destroy the session if (event_queue_interesting_fd_has_error(events, i)) { + if (interesting_fd == cr_session->instance_fd) { + cr_session->instance_failed = 1; + } corerouter_close_session(ucr, cr_session); continue; } diff --git a/plugins/fastrouter/fastrouter.c b/plugins/fastrouter/fastrouter.c index bc065473..53836c76 100644 --- a/plugins/fastrouter/fastrouter.c +++ b/plugins/fastrouter/fastrouter.c @@ -103,7 +103,7 @@ ssize_t fr_write_body(struct corerouter_session * cs) { fs->post_buf_pos += len; // the body chunk has been sent, start again reading from client and instance - if (fs->post_buf_pos == fs->post_buf_len) { + if (fs->post_buf_pos == (size_t) fs->post_buf_len) { uwsgi_cr_hook_instance_write(cs, NULL); uwsgi_cr_hook_instance_read(cs, fr_instance_read_response); uwsgi_cr_hook_read(cs, fr_read_body); @@ -148,7 +148,7 @@ ssize_t fr_write_response(struct corerouter_session * cs) { cs->buffer_pos += len; // ok this response chunk is sent, let's wait for another one - if (cs->buffer_pos == cs->buffer_len) { + if (cs->buffer_pos == (size_t) cs->buffer_len) { uwsgi_cr_hook_write(cs, NULL); uwsgi_cr_hook_instance_read(cs, fr_instance_read_response); }