diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-11-29 17:05:31 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-11-29 17:05:31 +0100 |
commit | f2eb844d53f16586b67e4d753b705838808567d9 (patch) | |
tree | 520236dc25ec6648f332a51e50ab820e37bf1f56 /src/biruda.c | |
parent | 1135bfb7aa76ea4ec5cff756cc6f0f98332e9828 (diff) | |
download | biruda-f2eb844d53f16586b67e4d753b705838808567d9.tar.gz biruda-f2eb844d53f16586b67e4d753b705838808567d9.tar.bz2 |
fixed POST in http_lib
changed POST request for starting workers and added proper error handling
whole chain is working now
Diffstat (limited to 'src/biruda.c')
-rw-r--r-- | src/biruda.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/biruda.c b/src/biruda.c index 685c3ff..3c108cb 100644 --- a/src/biruda.c +++ b/src/biruda.c @@ -414,24 +414,13 @@ static void print_status( ) static void start_worker( const char *worker_name ) { char url[128]; - snprintf( url, sizeof( url ), "start?op=start&type=worker&name=%s", worker_name ); - char *data = NULL; - int len; - http_retcode ret = http_post( url, "", 0, "Content-Type: text/plain", - &data, &len, NULL ); + snprintf( url, sizeof( url ), "worker?op=start&name=%s", worker_name ); + http_retcode ret = http_post( url, "", 0, "Content-Type: text/plain" ); if( ret == 200 ) { - if( strlen( data ) > 0 && data[len-1] == '\n' ) { - data[len-1] = '\0'; - len--; - } - if( strlen( data ) > 0 && data[len-1] == '\r' ) { - data[len-1] = '\0'; - } - print_answer( data ); + print_answer( "Request queued" ); } else { print_error( "ERROR: HTTP error %d", ret ); } - free( data ); } static int start_interactive( bool colors ) |