[asterisk-commits] russell: branch group/http_mods r60167 -
/team/group/http_mods/main/minimime/...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Apr 4 10:56:06 MST 2007
Author: russell
Date: Wed Apr 4 12:56:05 2007
New Revision: 60167
URL: http://svn.digium.com/view/asterisk?view=rev&rev=60167
Log:
update mytest to run and show a problem with running the parser more than once
Modified:
team/group/http_mods/main/minimime/mytest_files/mytest.c
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=60167&r1=60166&r2=60167
==============================================================================
--- team/group/http_mods/main/minimime/mytest_files/mytest.c (original)
+++ team/group/http_mods/main/minimime/mytest_files/mytest.c Wed Apr 4 12:56:05 2007
@@ -51,16 +51,17 @@
}
/* This is where the problems are demonstrated. */
-
- if ((disp = mm_mimepart_getheadervalue(part, "Content-Disposition", 0)))
- printf("SUCCESS: Got the Content-Disposition header: %s\n", disp);
+ cont = mm_mimepart_getcontent(part);
+
+ if ((disp = mm_content_getdispositiontype(cont)))
+ printf("SUCCESS: Got the Content-Disposition: %s\n", disp);
else
- printf("FAILURE: Could not get the Content-Disposition header value!\n");
-
+ 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);
+ //printf("Interesting: the mimepart name is %s\n", part->the_name);
res = mm_mimepart_getlength(part);
if (res)
@@ -71,25 +72,5 @@
mm_context_free(ctx);
}
- /* This is where the problems are demonstrated. */
-
- cont = mm_mimepart_getcontent(part);
-
- if ((disp = mm_content_getdispositiontype(cont)))
- printf("SUCCESS: Got the Content-Disposition: %s\n", disp);
- 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 */
-
- res = mm_mimepart_getlength(part);
- if (res)
- printf("SUCCESS: Got a non-zero value for the body length: %d\n", res);
- else
- printf("FAILURE: The silly parser says this MIME part has 0 length!\n");
-
-cleanup:
- mm_context_free(ctx);
exit(res);
}
More information about the asterisk-commits
mailing list