}
-
+/*
+ * 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;
+ }
+ }
+}
INLINE void become_session(struct CitContext *which_con);
void InitializeMasterCC(void);
void dead_session_purge(int force);
+void set_async_waiting(struct CitContext *ccptr);
/* Deprecated, user CtdlBumpNewMailCounter() instead */
void BumpNewMailCounter(long) __attribute__ ((deprecated));
/* If the target context is a session which can handle asynchronous
* messages, go ahead and set the flag for that.
*/
- if (ccptr->is_async) {
- ccptr->async_waiting = 1;
- if (ccptr->state == CON_IDLE) {
- ccptr->state = CON_READY;
- }
- }
+ set_async_waiting(ccptr);
}
begin_critical_section(S_SESSION_TABLE);
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if ((cptr->logged_in) && (cptr->h_async_function == xmpp_async_loop)) {
- cptr->async_waiting = 1;
+ set_async_waiting(cptr);
}
}
end_critical_section(S_SESSION_TABLE);