#include "spiceterm.h"
+static int debug = 0;
+
+#define DPRINTF(x, format, ...) { \
+ if (x <= debug) { \
+ printf("%s: " format "\n" , __FUNCTION__, ## __VA_ARGS__); \
+ } \
+}
+
#define MEM_SLOT_GROUP_ID 0
#define NOTIFY_DISPLAY_BATCH (SINGLE_PART/2)
{
SpiceScreen *spice_screen = SPICE_CONTAINEROF(qin, SpiceScreen, qxl_instance);
- printf("%s: present %d caps %d\n", __func__, client_present, caps[0]);
+ DPRINTF(1, "%s: present %d caps %d", __func__, client_present, caps[0]);
if (spice_screen->on_client_connected && client_present) {
spice_screen->on_client_connected(spice_screen);
static void
client_connected(SpiceScreen *spice_screen)
{
- printf("Client connected\n");
client_count++;
+
+ DPRINTF(1, "%s: client_count = %d", __func__, client_count);
}
static void
client_disconnected(SpiceScreen *spice_screen)
{
-
if (client_count > 0) {
client_count--;
- printf("Client disconnected\n");
+ DPRINTF(1, "%s: client_count = %d", __func__, client_count);
exit(0); // fixme: cleanup?
}
}
// SpiceScreen *spice_screen = opaque;
if (client_count <= 0) {
- printf("connection timeout\n");
+ printf("connection timeout - stopping server\n");
exit (0); // fixme: cleanup?
}
}