summaryrefslogtreecommitdiff
path: root/src/webserver.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-12-21 13:39:06 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-12-21 13:39:06 +0100
commite8d7e3401051dd9d8e2992ae0ed0d5149a6bdcc5 (patch)
treeeaeab3af96f568dd04e27d31be3471b7fe9dc9ea /src/webserver.c
parent4ed9394c0c2ba0ae65a20861fa998d7b701f8640 (diff)
downloadbiruda-e8d7e3401051dd9d8e2992ae0ed0d5149a6bdcc5.tar.gz
biruda-e8d7e3401051dd9d8e2992ae0ed0d5149a6bdcc5.tar.bz2
added a tail of worker output messages (needed for a web client showing the last lines of output)
Diffstat (limited to 'src/webserver.c')
-rw-r--r--src/webserver.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/webserver.c b/src/webserver.c
index f30a811..9b62f0e 100644
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -60,11 +60,20 @@ static int handle_request( void *cls, struct MHD_Connection *connection,
const char *name = MHD_lookup_connection_value( connection, MHD_GET_ARGUMENT_KIND, "name" );
if( name != NULL ) {
+ master_output_outstanding_messages( name, biruda_msg, sizeof( biruda_msg ) );
+ } else {
+ return MHD_NO;
+ }
+ } else if( strcmp( op, "tail" ) == 0 ) {
+
+ const char *name = MHD_lookup_connection_value( connection, MHD_GET_ARGUMENT_KIND, "name" );
+
+ if( name != NULL ) {
master_output_tail( name, biruda_msg, sizeof( biruda_msg ) );
} else {
return MHD_NO;
}
- }
+ }
} else {
snprintf( biruda_msg, sizeof( biruda_msg ), "Welcome to biruda! Please state your wish..\n" );