diff options
-rw-r--r-- | includes/Selectable.h | 2 | ||||
-rw-r--r-- | src/HelperTasks.cc | 4 | ||||
-rw-r--r-- | src/HttpServer.cc | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/includes/Selectable.h b/includes/Selectable.h index 8667415..5dab7cb 100644 --- a/includes/Selectable.h +++ b/includes/Selectable.h @@ -26,7 +26,7 @@ class Selectable : public Handle { public: SelectableEvent(int fd, int evt = ev::READ | ev::WRITE) : m_task(NULL), m_evtType(evt), m_fd(fd) { Printer::elog(E_SELECT, "Got a new SelectableEvent at %p", this); m_evt.set<SelectableEvent, &SelectableEvent::evt_cb>(this); m_evt.set(fd, evt); } virtual ~SelectableEvent() { Printer::elog(E_SELECT, "Destroying a SelectableEvent at %p", this); m_evt.stop(); } - void stop() { Printer::elog(E_SELECT, "Stopping a SelectableEvent at %p", this); reset(); m_evt.stop(); } + void stop() { Printer::elog(E_SELECT, "Stopping a SelectableEvent at %p", this); resetMaybe(); m_evt.stop(); } private: void evt_cb(ev::io & w, int revents) { Printer::elog(E_SELECT, "Got a libev callback on a SelectableEvent at %p", this); doSignal(); } virtual void gotOwner(Task * task); diff --git a/src/HelperTasks.cc b/src/HelperTasks.cc index ab1c2a9..074aa8d 100644 --- a/src/HelperTasks.cc +++ b/src/HelperTasks.cc @@ -21,7 +21,7 @@ void Balau::CopyTask::Do() { toread = std::min(toread, (ssize_t) COPY_BUFSIZE); m_read = m_s->read(m_buffer, toread); AAssert(m_read >= 0, "Error while reading"); - if (m_s->isEOF() || !m_read) + if (!m_read) return; m_written = 0; m_state = 1; @@ -33,6 +33,8 @@ void Balau::CopyTask::Do() { } while (m_read != m_written); m_state = 0; m_current += m_read; + if (m_s->isEOF()) + return; } } } diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 8eea5bb..921da3b 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -559,6 +559,7 @@ bool Balau::HttpWorker::handleClient() { auto f = m_server->findAction(uri.to_charp(), host.to_charp()); if (f.action) { + setOkayToEAgain(false); m_strm->detach(); IO<OutputCheck> out(new OutputCheck(m_socket)); Http::Request req; |