aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_multipart.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cow_multipart.erl')
-rw-r--r--src/cow_multipart.erl19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/cow_multipart.erl b/src/cow_multipart.erl
index 284c597..276a689 100644
--- a/src/cow_multipart.erl
+++ b/src/cow_multipart.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2014, Loïc Hoguin <[email protected]>
+%% Copyright (c) 2014-2015, Loïc Hoguin <[email protected]>
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
@@ -98,7 +98,7 @@
>>).
-define(TEST4_BOUNDARY, <<"boundary">>).
-%% RFC 2046, Section 5.1.1:
+%% RFC 2046, Section 5.1.1
-define(TEST5_MIME, <<
"This is the preamble. It is to be ignored, though it\r\n"
"is a handy place for composition agents to include an\r\n"
@@ -203,8 +203,7 @@ skip_preamble(Stream, Boundary) ->
end.
before_parse_headers(<< "\r\n\r\n", Stream/bits >>) ->
- %% This indicates that there are no headers, so we can abort
- %% immediately.
+ %% This indicates that there are no headers, so we can abort immediately.
{ok, [], Stream};
before_parse_headers(<< "\r\n", Stream/bits >>) ->
%% There is a line break right after the boundary, skip it.
@@ -364,7 +363,7 @@ parse_epilogue_crlf_test() ->
ok.
parse_rfc2046_test() ->
- %% The following is an included in RFC 2046, Section 5.1.1.
+ %% The following is an example included in RFC 2046, Section 5.1.1.
Body1 = <<"This is implicitly typed plain US-ASCII text.\r\n"
"It does NOT end with a linebreak.">>,
Body2 = <<"This is explicitly typed plain US-ASCII text.\r\n"
@@ -400,9 +399,7 @@ parse_partial_test() ->
{ok, <<"boundary">>, <<"\r\n--">>}
= parse_body(<<"boundary\r\n--">>, <<"boundary">>),
ok.
--endif.
--ifdef(PERF).
perf_parse_multipart(Stream, Boundary) ->
case parse_headers(Stream, Boundary) of
{ok, _, Rest} ->
@@ -499,9 +496,7 @@ identity_test() ->
{done, Body2, M6} = parse_body(M5, B),
{done, Epilogue} = parse_headers(M6, B),
ok.
--endif.
--ifdef(PERF).
perf_build_multipart() ->
B = boundary(),
[
@@ -613,9 +608,7 @@ parse_content_disposition_test_() ->
{<<"file">>, [{<<"filename">>, <<"file2.gif">>}]}}
],
[{V, fun() -> R = parse_content_disposition(V) end} || {V, R} <- Tests].
--endif.
--ifdef(PERF).
horse_parse_content_disposition_attachment() ->
horse:repeat(100000,
parse_content_disposition(<<"attachment; filename=genome.jpeg;"
@@ -655,9 +648,7 @@ parse_content_transfer_encoding_test_() ->
],
[{V, fun() -> R = parse_content_transfer_encoding(V) end}
|| {V, R} <- Tests].
--endif.
--ifdef(PERF).
horse_parse_content_transfer_encoding() ->
horse:repeat(100000,
parse_content_transfer_encoding(<<"QUOTED-PRINTABLE">>)
@@ -718,9 +709,7 @@ parse_content_type_test_() ->
],
[{V, fun() -> R = parse_content_type(V) end}
|| {V, R} <- Tests].
--endif.
--ifdef(PERF).
horse_parse_content_type_zero() ->
horse:repeat(100000,
parse_content_type(<<"text/plain">>)