Only in .: .libs Only in .: Makefile Only in .: base64.lo Only in .: base64.o Only in .: connect.lo Only in .: connect.o Only in .: cookie.lo Only in .: cookie.o Only in .: dict.lo Only in .: dict.o Only in .: diff.txt Only in .: easy.lo Only in .: easy.o Only in .: escape.lo Only in .: escape.o Only in .: file.lo Only in .: file.o diff -u d:\dev\curl-7.9.1\lib/formdata.c ./formdata.c --- d:\dev\curl-7.9.1\lib/formdata.c Mon Oct 29 14:21:26 2001 +++ ./formdata.c Wed Nov 28 11:59:22 2001 @@ -400,8 +400,9 @@ long namelength, char * value, long contentslength, - char *contenttype, + char *contenttype, long flags, + struct curl_slist* contentHeader, struct HttpPost *parent_post, struct HttpPost **httppost, struct HttpPost **last_post) @@ -415,6 +416,7 @@ post->contents = value; post->contentslength = contentslength; post->contenttype = contenttype; + post->contentHeader = contentHeader; post->flags = flags; } else @@ -823,6 +825,21 @@ } break; } + case CURLFORM_CONTENTHEADER: + { + struct curl_slist* list = NULL; + if( array_state ) + list = (struct curl_slist*)array_value; + else + list = va_arg(params,struct curl_slist*); + + if( current_form->contentheader ) + return_value = FORMADD_OPTION_TWICE; + else + current_form->contentheader = list; + + break; + } default: fprintf (stderr, "got unknown CURLFORM_OPTION: %d\n", option); return_value = FORMADD_UNKNOWN_OPTION; @@ -875,6 +892,7 @@ if ( (post = AddHttpPost(form->name, form->namelength, form->value, form->contentslength, form->contenttype, form->flags, + form->contentheader, post, httppost, last_post)) == NULL) { return_value = FORMADD_MEMORY; @@ -922,8 +940,8 @@ if(!length) length = strlen((char *)line); - newform->line = (char *)malloc(length+1); - memcpy(newform->line, line, length+1); + newform->line = (char *)malloc(length +1); + memcpy(newform->line, line, length); newform->length = length; newform->line[length]=0; /* zero terminate for easier debugging */ @@ -1029,6 +1047,8 @@ int size =0; char *boundary; char *fileboundary=NULL; + struct curl_slist* curList; + if(!post) return NULL; /* no input => no output! */ @@ -1089,6 +1109,14 @@ "\r\nContent-Type: %s", file->contenttype); } + + curList = file->contentHeader; + while( curList ) + { + /* Process the additional headers specified for this form */ + size += AddFormDataf( &form, "\r\n%s", curList->data ); + curList = curList->next; + } #if 0 /* The header Content-Transfer-Encoding: seems to confuse some receivers diff -u d:\dev\curl-7.9.1\lib/formdata.h ./formdata.h --- d:\dev\curl-7.9.1\lib/formdata.h Tue Aug 28 11:54:34 2001 +++ ./formdata.h Wed Nov 28 11:59:26 2001 @@ -44,6 +44,7 @@ long contentslength; char *contenttype; long flags; + struct curl_slist* contentheader; struct FormInfo *more; } FormInfo; Only in .: formdata.lo Only in .: formdata.o Only in .: ftp.lo Only in .: ftp.o Only in .: getdate.lo Only in .: getdate.o Only in .: getenv.lo Only in .: getenv.o Only in .: getinfo.lo Only in .: getinfo.o Only in .: getpass.lo Only in .: getpass.o Only in .: hostip.lo Only in .: hostip.o Only in .: http.lo Only in .: http.o Only in .: http_chunks.lo Only in .: http_chunks.o Only in .: if2ip.lo Only in .: if2ip.o Only in .: krb4.lo Only in .: krb4.o Only in .: ldap.lo Only in .: ldap.o Only in .: libcurl.la Only in .: memdebug.lo Only in .: memdebug.o Only in .: mprintf.lo Only in .: mprintf.o Only in .: netrc.lo Only in .: netrc.o Only in .: progress.lo Only in .: progress.o Only in .: security.lo Only in .: security.o Only in .: sendf.lo Only in .: sendf.o Only in .: speedcheck.lo Only in .: speedcheck.o Only in .: ssluse.lo Only in .: ssluse.o Only in .: strequal.lo Only in .: strequal.o Only in .: strtok.lo Only in .: strtok.o Only in .: telnet.lo Only in .: telnet.o Only in .: timeval.lo Only in .: timeval.o Only in .: transfer.lo Only in .: transfer.o Only in .: url.lo Only in .: url.o Only in .: version.lo Only in .: version.o