summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-11-14 10:49:14 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-11-14 10:49:14 +0100
commit0fcd6d23cb647f686c6b01c81dcc5e2b057d8948 (patch)
tree3f73ecefdb7137ea3096b9f8562dbf4bcc24b87e
parent8db8f32cec78eed65dd06be6ca6a8ff775f35682 (diff)
downloadbiruda-0fcd6d23cb647f686c6b01c81dcc5e2b057d8948.tar.gz
biruda-0fcd6d23cb647f686c6b01c81dcc5e2b057d8948.tar.bz2
..
-rw-r--r--src/master.c12
-rw-r--r--src/webserver.c10
2 files changed, 17 insertions, 5 deletions
diff --git a/src/master.c b/src/master.c
index f2d9835..53b71b8 100644
--- a/src/master.c
+++ b/src/master.c
@@ -16,6 +16,18 @@ static int master_must_terminate = 0;
coordinator_t coordinator[MAX_COORDINATORS];
+static void reregister_coordinator( const char *host )
+{
+ int pos;
+ for( pos = 0; pos < MAX_COORDINATORS; pos++ ) {
+ if( coordinator[pos].used &&
+ strcmp( coordinator[pos].host, host ) == 0 ) {
+ coordinator[pos].used = false;
+ return;
+ }
+ }
+}
+
static void register_coordinator( json_object *obj )
{
json_object *host_obj;
diff --git a/src/webserver.c b/src/webserver.c
index 6f67fdc..b162b63 100644
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -25,19 +25,19 @@ static int handle_request( void *cls, struct MHD_Connection *connection,
fprintf( stderr, "http request: %s\n", url );
- char biruda_msg[1024];
+ char biruda_msg[2048];
biruda_msg[0] = '\0';
if( strcmp( url, "/status" ) == 0 ) {
for( int pos = 0; pos < MAX_COORDINATORS; pos++ ) {
coordinator_t *c = &coordinator[pos];
if( c->used ) {
- char part[128];
- snprintf( part, 128, "%s %s %s %d (%d)\n", c->host, c->os, c->arch, c->cpus, pos );
- strncat( biruda_msg, part, 1024 );
+ char part[256];
+ snprintf( part, 256, "%s %s %s %d (%d)\n", c->host, c->os, c->arch, c->cpus, pos );
+ strncat( biruda_msg, part, 2048 );
}
}
} else {
- snprintf( biruda_msg, 1024, "Welcome to biruda! Please state your wish..\n" );
+ snprintf( biruda_msg, 2048, "Welcome to biruda! Please state your wish..\n" );
}
response = MHD_create_response_from_buffer( strlen( biruda_msg ),