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/3rdParty | |
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/3rdParty')
-rw-r--r-- | src/3rdParty/http_tiny/http_lib.c | 26 | ||||
-rw-r--r-- | src/3rdParty/http_tiny/http_lib.h | 3 |
2 files changed, 11 insertions, 18 deletions
diff --git a/src/3rdParty/http_tiny/http_lib.c b/src/3rdParty/http_tiny/http_lib.c index 93743a7..8bb7384 100644 --- a/src/3rdParty/http_tiny/http_lib.c +++ b/src/3rdParty/http_tiny/http_lib.c @@ -296,32 +296,26 @@ http_retcode http_put(filename, data, length, overwrite, type) * * limitations: filename is truncated to first 256 characters * and type to 64. + * buf: for now we can't handle the body of the answer to a POST request */ -http_retcode http_post(filename, data_in, length_in, type_in, data_out, length_out, type_out) +http_retcode http_post(filename, data, length, type) char *filename; /* name of the ressource to create */ - char *data_in; /* pointer to the data to send */ - int length_in; /* length of the data to send */ - char *type_in; /* type of the data, if NULL default type is used */ - char **data_out; /* address of a pointer variable which will be set - to point toward allocated memory containing read data.*/ - int *length_out;/* address of integer variable which will be set to - length of the read data */ - char *type_out; /* allocated buffer where the read data type is returned. - If NULL, the type is not returned */ + char *data; /* pointer to the data to send */ + int length; /* length of the data to send */ + char *type; /* type of the data, if NULL default type is used */ { char header[MAXBUF]; - if (type_in) + if (type) sprintf(header,"Content-length: %d\015\012Content-type: %.64s\015\012", - length_in, - type_in + length, + type ); else - sprintf(header,"Content-length: %d\015\012",length_in + sprintf(header,"Content-length: %d\015\012",length ); - return http_query("POST",filename,header,CLOSE, data_out, length_out, type_out); + return http_query("POST",filename,header,CLOSE, data, length, NULL); } - /* * Get data from the server * diff --git a/src/3rdParty/http_tiny/http_lib.h b/src/3rdParty/http_tiny/http_lib.h index 2bc72ab..2121282 100644 --- a/src/3rdParty/http_tiny/http_lib.h +++ b/src/3rdParty/http_tiny/http_lib.h @@ -69,7 +69,6 @@ http_retcode http_delete(char *filename) ; http_retcode http_head(char *filename, int *plength, char *typebuf); -http_retcode http_post(char *filename, char *data_in, int length_in, char *type_in, - char **data_out, int *length_out, char *type_out); +http_retcode http_post(char *filename, char *data, int length, char *type); #endif |