summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv/chansrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/chansrv/chansrv.c')
-rw-r--r--sesman/chansrv/chansrv.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index e3d2f5d2..918bb832 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -35,6 +35,8 @@
#include "chansrv_fuse.h"
#include "drdynvc.h"
+#include "libraptorsmiface.h"
+
static struct trans *g_lis_trans = 0;
static struct trans *g_con_trans = 0;
static struct trans *g_api_lis_trans = 0;
@@ -221,6 +223,32 @@ g_is_term(void)
return g_is_wait_obj_set(g_term_event);
}
+#if 0
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+void dprint(const char *fmt, ...)
+{
+ va_list argp;
+ va_start(argp, fmt);
+ char debug[1024];
+ vsprintf(debug, fmt, argp);
+ FILE *fp = fopen("/chansrv.debug", "a");
+ if (fp != NULL)
+ {
+ fputs(debug, fp);
+ fclose(fp);
+ }
+ va_end(argp);
+}
+#undef LOG
+#define LOG(_a, _params) \
+{ \
+ dprint _params; \
+ dprint("\n"); \
+}
+#endif
+
/*****************************************************************************/
/* add data to chan_item, on its way to the client */
/* returns error */
@@ -468,8 +496,14 @@ send_channel_data_response_message(void)
static int APP_CC
process_message_init(struct stream *s)
{
+ int rv = 0;
LOGM((LOG_LEVEL_DEBUG, "process_message_init:"));
- return send_init_response_message();
+ rv = send_init_response_message();
+ if (!rv)
+ {
+ raptor_sm_set_session_state(g_display_num, SM_STATUS_CONNECTED);
+ }
+ return rv;
}
/*****************************************************************************/
@@ -1137,6 +1171,9 @@ channel_thread_loop(void *in_val)
/* delete g_con_trans */
trans_delete(g_con_trans);
g_con_trans = 0;
+ // Use the display number to mark session disconnected in the Raptor session management database
+ raptor_sm_set_session_state(g_display_num, SM_STATUS_RUNNING);
+ exit(0); // RAPTOR session management
/* create new listener */
error = setup_listen();
@@ -1587,6 +1624,8 @@ main(int argc, char **argv)
}
}
+ // Use the display number to mark session disconnected in the Raptor session management database
+ raptor_sm_set_session_state(g_display_num, SM_STATUS_RUNNING);
/* cleanup */
main_cleanup();
LOGM((LOG_LEVEL_INFO, "main: app exiting pid %d(0x%8.8x)", pid, pid));