* Noticed that when serv_chat.c sets async_waiting to 1, it also checks to see if...
[citadel.git] / citadel / context.c
index 38394b7f44e05484960faa26f4fd21e984154f1a..6c6a20453c214e7d5dad07d10923a5f35c75c24e 100644 (file)
@@ -586,4 +586,16 @@ INLINE void become_session(CitContext *which_con) {
 }
 
 
-
+/*
+ * Set the "async waiting" flag for a session, if applicable
+ */
+void set_async_waiting(struct CitContext *ccptr)
+{
+       CtdlLogPrintf(CTDL_DEBUG, "Setting async_waiting flag for session %d\n", ccptr->cs_pid);
+       if (ccptr->is_async) {
+               ccptr->async_waiting = 1;
+               if (ccptr->state == CON_IDLE) {
+                       ccptr->state = CON_READY;
+               }
+       }
+}