1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

test1520: Fixed initial teething problems

* Missing initialisation of upload status caused a seg fault
* Missing data termination caused corrupt data to be uploaded
* Data verification should be performed in <upload> element
* Added missing recipient list cleanup
This commit is contained in:
Steve Holme 2014-12-28 13:01:11 +00:00
parent 9459ee99ae
commit 0d037cfdce
2 changed files with 17 additions and 11 deletions

View File

@ -44,6 +44,9 @@ EHLO 1520
MAIL FROM:<sender@example.com>
RCPT TO:<recipient@example.com>
DATA
QUIT
</protocol>
<upload>
From: different
To: another
@ -54,6 +57,7 @@ To: another
..
body
</protocol>
.
</upload>
</verify>
</testcase>

View File

@ -30,16 +30,17 @@
#define FROM "<sender@example.com>"
static const char *payload_text[] = {
"From: different\r\n",
"To: another\r\n",
"\r\n",
"\r\n",
".\r\n",
".\r\n",
"\r\n",
".\r\n",
"\r\n",
"body"
"From: different\r\n",
"To: another\r\n",
"\r\n",
"\r\n",
".\r\n",
".\r\n",
"\r\n",
".\r\n",
"\r\n",
"body",
NULL
};
struct upload_status {
@ -103,6 +104,7 @@ int test(char *URL)
test_cleanup:
curl_slist_free_all(rcpt_list);
curl_easy_cleanup(curl);
curl_global_cleanup();