diff options
Diffstat (limited to 'lib/formdata.c')
-rw-r--r-- | lib/formdata.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/formdata.c b/lib/formdata.c index eff0212e4..fb6ad0f69 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -60,6 +60,8 @@ #include <curl/curl.h> #include "formdata.h" +#include "strequal.h" + /* Length of the random boundary string. The risk of this being used in binary data is very close to zero, 64^32 makes 6277101735386680763835789423207666416102355444464034512896 @@ -377,7 +379,7 @@ void FormFree(struct FormData *form) free(form->line); /* free the line */ free(form); /* free the struct */ - } while(form=next); /* continue */ + } while((form=next)); /* continue */ } struct FormData *getFormData(struct HttpPost *post, @@ -513,11 +515,16 @@ struct FormData *getFormData(struct HttpPost *post, int FormInit(struct Form *form, struct FormData *formdata ) { - form->data = formdata; - form->sent = 0; - if(!formdata) return 1; /* error */ + + /* First, make sure that we'll send a nice terminating sequence at the end + * of the post. We *DONT* add this string to the size of the data since this + * is actually AFTER the data. */ + AddFormDataf(&formdata, "\r\n\r\n"); + + form->data = formdata; + form->sent = 0; return 0; } |