]> granicus.if.org Git - curl/commitdiff
test1520: Fixed initial teething problems
authorSteve Holme <steve_holme@hotmail.com>
Sun, 28 Dec 2014 13:01:11 +0000 (13:01 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 28 Dec 2014 13:04:15 +0000 (13:04 +0000)
* 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

tests/data/test1520
tests/libtest/lib1520.c

index c8b62fd074fbb4f212929ed408e4884b2b1bba03..5f9344d94e525f955e38b0538742dde912c853a0 100644 (file)
@@ -44,6 +44,9 @@ EHLO 1520
 MAIL FROM:<sender@example.com>\r
 RCPT TO:<recipient@example.com>\r
 DATA\r
+QUIT\r
+</protocol>
+<upload>
 From: different\r
 To: another\r
 \r
@@ -54,6 +57,7 @@ To: another
 ..\r
 \r
 body\r
-</protocol>
+.\r
+</upload>
 </verify>
 </testcase>
index bef1e13649e810a4e3bd45718b53fad9a70ac3bc..c6d2e820a819a60f5c74221cb38d02e716aa9e81 100644 (file)
 #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();