[svn-commits] russell: branch group/http_mods r60192 - in /team/group/http_mods/main/minimi...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Apr 4 16:04:51 MST 2007


Author: russell
Date: Wed Apr  4 18:04:50 2007
New Revision: 60192

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60192
Log:
Update mytest to show a parsing failure on a different set of data

Added:
    team/group/http_mods/main/minimime/mytest_files/ast_postdata2   (with props)
Modified:
    team/group/http_mods/main/minimime/mimeparser.y
    team/group/http_mods/main/minimime/mytest_files/mytest.c

Modified: team/group/http_mods/main/minimime/mimeparser.y
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/mimeparser.y?view=diff&rev=60192&r1=60191&r2=60192
==============================================================================
--- team/group/http_mods/main/minimime/mimeparser.y (original)
+++ team/group/http_mods/main/minimime/mimeparser.y Wed Apr  4 18:04:50 2007
@@ -550,7 +550,7 @@
 		current_mimepart->opaque_body = body;
 		current_mimepart->body = body + offset;
 		current_mimepart->opaque_length = strlen(body);
-		current_mimepart->length = current_mimepart->opaque_length - offset;
+		current_mimepart->length = current_mimepart->opaque_length - offset - 1;
 	}
 	;
 

Added: team/group/http_mods/main/minimime/mytest_files/ast_postdata2
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/mytest_files/ast_postdata2?view=auto&rev=60192
==============================================================================
Binary file - no diff available.

Propchange: team/group/http_mods/main/minimime/mytest_files/ast_postdata2
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: team/group/http_mods/main/minimime/mytest_files/mytest.c
URL: http://svn.digium.com/view/asterisk/team/group/http_mods/main/minimime/mytest_files/mytest.c?view=diff&rev=60192&r1=60191&r2=60192
==============================================================================
--- team/group/http_mods/main/minimime/mytest_files/mytest.c (original)
+++ team/group/http_mods/main/minimime/mytest_files/mytest.c Wed Apr  4 18:04:50 2007
@@ -5,7 +5,7 @@
 
 int main(int argc, char *argv[])
 {
-	const char *filename = "mytest_files/ast_postdata";
+	const char *filename = "mytest_files/ast_postdata2";
 	MM_CTX *ctx;
 	struct mm_mimepart *part;
 	struct mm_content *cont;
@@ -58,16 +58,11 @@
 		else
 			printf("FAILURE: Could not get the Content-Disposition value!\n");
 
-		/* hmmm... strange, headers don't have params, which is really quite not-nice! */
-		/* but the author has been storing Content-Disposition params in the part structure */
-	
-		//printf("Interesting: the mimepart name is %s\n", part->the_name);
-	
 		res = mm_mimepart_getlength(part);
-		if (res)
-			printf("SUCCESS: Got a non-zero value for the body length: %d\n\n", res);
+		if (res == 1279)
+			printf("SUCCESS: Got the correct value for the body length: %d\n\n", res);
 		else
-			printf("FAILURE: The silly parser says this MIME part has 0 length!\n\n");
+			printf("FAILURE: The parser says this MIME part has %d length, but it should be 1279\n\n", res);
 
 		mm_context_free(ctx);
 	}



More information about the svn-commits mailing list