Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #132 from moai/develop

Call filters that register for the CLOSE event(cherry picked from commit 73eb1b3)
  • Loading branch information...
commit 3c6685b26f078caaa9a9676fcd3e4c698e78445d 1 parent 16011f9
@jasom jasom authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/connection.c
View
10 src/connection.c
@@ -855,19 +855,19 @@ void Connection_task(void *v)
{
Connection *conn = (Connection *)v;
int i = 0;
- int next = 0;
+ int next = OPEN;
State_init(&conn->state, &CONN_ACTIONS);
- for(i = 0, next = OPEN; next != CLOSE; i++) {
+ while(1) {
if(Filter_activated()) {
next = Filter_run(next, conn);
check(next >= CLOSE && next < EVENT_END,
"!!! Invalid next event[%d]: %d from filter!", i, next);
-
- if(next == CLOSE) break;
}
+ if(next == CLOSE) break;
+
next = State_exec(&conn->state, next, (void *)conn);
check(next >= CLOSE && next < EVENT_END,
@@ -876,6 +876,8 @@ void Connection_task(void *v)
if(conn->iob && !conn->iob->closed) {
Register_ping(IOBuf_fd(conn->iob));
}
+
+ i++;
}
error: // fallthrough
Please sign in to comment.
Something went wrong with that request. Please try again.