diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-14 17:48:43 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-14 17:48:43 +0100 |
commit | 391222b8a5d4a69018b530859c8a0bcad05cf08a (patch) | |
tree | b79ad18b9944726583b31bed6d9384695f4f12e0 /src/webserver.c | |
parent | 259ca5ed40b727de03c45479ff374d1bb7c39630 (diff) | |
download | biruda-391222b8a5d4a69018b530859c8a0bcad05cf08a.tar.gz biruda-391222b8a5d4a69018b530859c8a0bcad05cf08a.tar.bz2 |
..
Diffstat (limited to 'src/webserver.c')
-rw-r--r-- | src/webserver.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/webserver.c b/src/webserver.c index 3e3d2e7..f30a811 100644 --- a/src/webserver.c +++ b/src/webserver.c @@ -46,7 +46,26 @@ static int handle_request( void *cls, struct MHD_Connection *connection, } } } else if( strcmp( url, "/worker" ) == 0 ) { - snprintf( biruda_msg, sizeof( biruda_msg ), "messages ..\n" ); + + const char *op = MHD_lookup_connection_value( connection, MHD_GET_ARGUMENT_KIND, "op" ); + + printf( "Got GET operation '%s'\n", op ); + + if( op == NULL ) { + return MHD_NO; + } + + if( strcmp( op, "output" ) == 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" ); } |