diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-11-23 19:49:11 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-11-23 19:49:11 +0100 |
commit | a784c8f795f60604a2cd6f9633a213e891e4d7df (patch) | |
tree | 2e115572d1bc28243237c5a525548b6a7206d7cd /src/3rdParty | |
parent | 7b6d970a87fbfc2079ba98a26c0b457cc8cd05ee (diff) | |
download | biruda-a784c8f795f60604a2cd6f9633a213e891e4d7df.tar.gz biruda-a784c8f795f60604a2cd6f9633a213e891e4d7df.tar.bz2 |
got to POSTing the start command to the master, now we have to design the messaging below
Diffstat (limited to 'src/3rdParty')
-rw-r--r-- | src/3rdParty/http_tiny/http_lib.c | 24 | ||||
-rw-r--r-- | src/3rdParty/http_tiny/http_lib.h | 4 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/3rdParty/http_tiny/http_lib.c b/src/3rdParty/http_tiny/http_lib.c index f11df19..93743a7 100644 --- a/src/3rdParty/http_tiny/http_lib.c +++ b/src/3rdParty/http_tiny/http_lib.c @@ -297,22 +297,28 @@ http_retcode http_put(filename, data, length, overwrite, type) * limitations: filename is truncated to first 256 characters * and type to 64. */ -http_retcode http_post(filename, data, length, type) +http_retcode http_post(filename, data_in, length_in, type_in, data_out, length_out, type_out) char *filename; /* name of the ressource to create */ - 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 *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 header[MAXBUF]; - if (type) + if (type_in) sprintf(header,"Content-length: %d\015\012Content-type: %.64s\015\012", - length, - type + length_in, + type_in ); else - sprintf(header,"Content-length: %d\015\012",length + sprintf(header,"Content-length: %d\015\012",length_in ); - return http_query("POST",filename,header,CLOSE, data, length, NULL); + return http_query("POST",filename,header,CLOSE, data_out, length_out, type_out); } diff --git a/src/3rdParty/http_tiny/http_lib.h b/src/3rdParty/http_tiny/http_lib.h index cd63c7c..2bc72ab 100644 --- a/src/3rdParty/http_tiny/http_lib.h +++ b/src/3rdParty/http_tiny/http_lib.h @@ -69,7 +69,7 @@ http_retcode http_delete(char *filename) ; http_retcode http_head(char *filename, int *plength, char *typebuf); -http_retcode http_post(char *filename, char *data, int length, - char *type) ; +http_retcode http_post(char *filename, char *data_in, int length_in, char *type_in, + char **data_out, int *length_out, char *type_out); #endif |