Fixed mg_fetch() by passing a buffer, placeholder for the reply headers

This commit is contained in:
Sergey Lyubka committed 2012-07-29 10:15:37 +01:00
1 parent 84e26ccddd
commit a9bb7d78ab
3 files changed
+28 -20

No files matched your search

+2 -1
View File
@@ -234,12 +234,13 @@ void mg_close_connection(struct mg_connection *conn);
// url: URL to download
// path: file name where to save the data
// request_info: pointer to a structure that will hold parsed reply headers
// buf, bul_len: a buffer for the reply headers
// Return:
// On success, opened file stream to the downloaded contents. The stream
// is positioned to the end of the file.
// On error, NULL
FILE *mg_fetch(struct mg_context *ctx, const char *url, const char *path,
struct mg_request_info *request_info);
char *buf, size_t buf_len, struct mg_request_info *request_info);
// Convenience function -- create detached thread.