Index: trunk/src_plugins/fp_wget/wget_common.c =================================================================== --- trunk/src_plugins/fp_wget/wget_common.c (revision 27461) +++ trunk/src_plugins/fp_wget/wget_common.c (revision 27462) @@ -67,7 +67,7 @@ if (f == NULL) goto error; if (!fp_wget_offline) - *f = pcb_wget_popen(url, update); + *f = pcb_wget_popen(url, update, NULL); if (*f == NULL) goto error; *fctx = FCTX_POPEN; @@ -94,7 +94,7 @@ if ((!fp_wget_offline) && !(mode & FP_WGET_OFFLINE)) { int res; sprintf(cmd, "%s/%s", cache_path, cdir); - res = pcb_wget_disk(url, cmd, update); + res = pcb_wget_disk(url, cmd, update, NULL); /* pcb_trace("------res=%d\n", res); */ if ((res != 0) && (res != 768)) { /* some versions of wget will return error on -c if the file doesn't need update; try to guess whether it's really an error */ /* when wget fails, a 0-long file might be left there - remove it so it won't block new downloads */ Index: trunk/src_plugins/lib_wget/lib_wget.c =================================================================== --- trunk/src_plugins/lib_wget/lib_wget.c (revision 27461) +++ trunk/src_plugins/lib_wget/lib_wget.c (revision 27462) @@ -31,19 +31,20 @@ #include "pcb-printf.h" #include "plugins.h" #include "safe_fs.h" +#include "lib_wget.h" const char *wget_cmd = "wget -U 'pcb-rnd-fp_wget'"; -static char *pcb_wget_command(const char *url, const char *ofn, int update) +static char *pcb_wget_command(const char *url, const char *ofn, int update, const pcb_wget_opts_t *opts) { const char *upds = update ? "-c" : ""; return pcb_strdup_printf("%s -O '%s' %s '%s'", wget_cmd, ofn, upds, url); } -int pcb_wget_disk(const char *url, const char *ofn, int update) +int pcb_wget_disk(const char *url, const char *ofn, int update, const pcb_wget_opts_t *opts) { int res; - char *cmd = pcb_wget_command(url, ofn, update); + char *cmd = pcb_wget_command(url, ofn, update, opts); res = pcb_system(NULL, cmd); free(cmd); @@ -50,10 +51,10 @@ return res; } -FILE *pcb_wget_popen(const char *url, int update) +FILE *pcb_wget_popen(const char *url, int update, const pcb_wget_opts_t *opts) { FILE *f; - char *cmd = pcb_wget_command(url, "-", update); + char *cmd = pcb_wget_command(url, "-", update, opts); f = pcb_popen(NULL, cmd, "rb"); free(cmd); Index: trunk/src_plugins/lib_wget/lib_wget.h =================================================================== --- trunk/src_plugins/lib_wget/lib_wget.h (revision 27461) +++ trunk/src_plugins/lib_wget/lib_wget.h (revision 27462) @@ -27,13 +27,18 @@ #ifndef PCB_LIB_WGET #define PCB_LIB_WGET +typedef struct { + const char **header; + const char *post_file; +} pcb_wget_opts_t; + /* download the document at url to a local file ofn; if update is non-zero, try to continue the download or update the file */ -int pcb_wget_disk(const char *url, const char *ofn, int update); +int pcb_wget_disk(const char *url, const char *ofn, int update, const pcb_wget_opts_t *opts); /* download and stream the document at url; if update is non-zero, try to continue the download or update the file */ -FILE *pcb_wget_popen(const char *url, int update); +FILE *pcb_wget_popen(const char *url, int update, const pcb_wget_opts_t *opts); #endif