A number of updates to do with service startup

Telnet protocol support

Debug cli
This commit is contained in:
Mark Riddoch
2013-06-19 12:31:40 +02:00
parent 461dc31578
commit 53b6bc0a25
21 changed files with 580 additions and 51 deletions

View File

@ -33,6 +33,7 @@
#include <session.h>
#include <server.h>
#include <spinlock.h>
#include <dcb.h>
static SPINLOCK server_spin = SPINLOCK_INIT;
static SERVER *allServers = NULL;
@ -139,3 +140,27 @@ SERVER *ptr;
}
spinlock_release(&server_spin);
}
/**
* Print all servers to a DCB
*
* Designed to be called within a debugger session in order
* to display all active servers within the gateway
*/
void
dprintAllServers(DCB *dcb)
{
SERVER *ptr;
spinlock_acquire(&server_spin);
ptr = allServers;
while (ptr)
{
dcb_printf(dcb, "Server %p\n", ptr);
dcb_printf(dcb, "\tServer: %s\n", ptr->name);
dcb_printf(dcb, "\tProtocol: %s\n", ptr->protocol);
dcb_printf(dcb, "\tPort: %d\n", ptr->port);
ptr = ptr->next;
}
spinlock_release(&server_spin);
}