static char* osrf_router = NULL;
static char* osrf_domain = NULL;
static osrfHash* stateful_session_cache = NULL;
-static char* client_ip;
-
-static time_t idle_timeout_interval = 120;
-static time_t idle_check_interval = 5;
-static time_t last_activity_time = 0;
-
-// Generally, we do not disconnect the client (as idle) if there is a
-// request in flight. However, we need to have an upper bound on the
-// amount of time we will wait for in-flight requests to complete to
-// avoid leaving an effectively idle connection open after a request
-// died on the backend and no response was received.
-// Note that if other activity occurs while a long-running request
-// is active, the wait time will get reset with each new activity.
-// This is OK, though, because the goal of max_request_wait_time
-// is not to chop requests off at the knees, it's to allow the client
-// to timeout as idle when only a single long-running request is active
-// and preventing timeout.
-static time_t max_request_wait_time = 600;
-
-// Incremented with every REQUEST, decremented with every COMPLETE.
-// Gives us a rough picture of the number of reqests we've sent to
-// the server vs. the number for which a completed response has been
-// received.
-static int requests_in_flight = 0;
-
+static char* client_ip = NULL;
static growing_buffer* stdin_buf = NULL;
static transport_client* osrf_handle = NULL;
static char recipient_buf[RECIP_BUF_SIZE]; // reusable recipient buffer
}
if (FD_ISSET(stdin_no, &fds)) {
- osrfLogDebug(OSRF_LOG_MARK, "STDIN active");
read_from_stdin();
}
if (FD_ISSET(osrf_no, &fds)) {
- osrfLogDebug(OSRF_LOG_MARK, "XMPP active");
read_from_osrf();
}
}
client_ip = getenv("REMOTE_ADDR");
osrfLogInfo(OSRF_LOG_MARK, "WS connect from %s", client_ip);
-
- // TODO read timeout ENV vars
}
message_free(tmsg);
jsonObjectFree(msg_wrapper);
free(msg_body);
-
- last_activity_time = time(NULL);
}
static char* extract_inbound_messages(
}
osrfLogActivity(OSRF_LOG_MARK, "%s", act->buf);
buffer_free(act);
- requests_in_flight++;
break;
}
osrfHashSet(stateful_session_cache, sender, tmsg->thread);
} else {
+
osrfLogWarning(OSRF_LOG_MARK,
"WS max concurrent sessions (%d) reached. "
"Current session will not be tracked",
if (recipToFree != NULL) {
free(recipToFree);
}
-
- } else {
- if (one_msg->status_code == OSRF_STATUS_COMPLETE)
- requests_in_flight--;
}
}
}