Author: cmlenz
Date: Fri Aug 21 11:54:24 2009
New Revision: 806513
URL: http://svn.apache.org/viewvc?rev=806513&view=rev
Log:
Back out Mochiweb patch from r659636 to support older Erlang versions, as those
are no longer supported by CouchDB anyway.
Modified:
couchdb/trunk/src/mochiweb/mochifmt.erl
couchdb/trunk/src/mochiweb/mochiweb_headers.erl
couchdb/trunk/src/mochiweb/mochiweb_html.erl
couchdb/trunk/src/mochiweb/mochiweb_multipart.erl
couchdb/trunk/src/mochiweb/mochiweb_util.erl
Modified: couchdb/trunk/src/mochiweb/mochifmt.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochifmt.erl?rev=806513&r1=806512&r2=806513&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochifmt.erl (original)
+++ couchdb/trunk/src/mochiweb/mochifmt.erl Fri Aug 21 11:54:24 2009
@@ -297,7 +297,7 @@
convert2(Arg, #conversion{ctype=upper_hex}) ->
erlang:integer_to_list(Arg, 16);
convert2(Arg, #conversion{ctype=hex}) ->
- mochiweb_util:to_lower(erlang:integer_to_list(Arg, 16));
+ string:to_lower(erlang:integer_to_list(Arg, 16));
convert2(Arg, #conversion{ctype=char}) when Arg < 16#80 ->
[Arg];
convert2(Arg, #conversion{ctype=char}) ->
Modified: couchdb/trunk/src/mochiweb/mochiweb_headers.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochiweb_headers.erl?rev=806513&r1=806512&r2=806513&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochiweb_headers.erl (original)
+++ couchdb/trunk/src/mochiweb/mochiweb_headers.erl Fri Aug 21 11:54:24 2009
@@ -168,7 +168,7 @@
V0 ++ ", " ++ V1.
normalize(K) when is_list(K) ->
- mochiweb_util:to_lower(K);
+ string:to_lower(K);
normalize(K) when is_atom(K) ->
normalize(atom_to_list(K));
normalize(K) when is_binary(K) ->
Modified: couchdb/trunk/src/mochiweb/mochiweb_html.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochiweb_html.erl?rev=806513&r1=806512&r2=806513&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochiweb_html.erl (original)
+++ couchdb/trunk/src/mochiweb/mochiweb_html.erl Fri Aug 21 11:54:24 2009
@@ -330,7 +330,7 @@
end.
parse_flag({start_tag, B, _, false}) ->
- case mochiweb_util:to_lower(binary_to_list(B)) of
+ case string:to_lower(binary_to_list(B)) of
"script" ->
script;
"textarea" ->
@@ -551,7 +551,7 @@
norm(Tag) when is_binary(Tag) ->
Tag;
norm(Tag) ->
- list_to_binary(mochiweb_util:to_lower(Tag)).
+ list_to_binary(string:to_lower(Tag)).
test_destack() ->
{<<"a">>, [], []} =
Modified: couchdb/trunk/src/mochiweb/mochiweb_multipart.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochiweb_multipart.erl?rev=806513&r1=806512&r2=806513&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochiweb_multipart.erl (original)
+++ couchdb/trunk/src/mochiweb/mochiweb_multipart.erl Fri Aug 21 11:54:24 2009
@@ -103,7 +103,7 @@
split_header(Line) ->
{Name, [$: | Value]} = lists:splitwith(fun (C) -> C =/= $: end,
binary_to_list(Line)),
- {mochiweb_util:to_lower(string:strip(Name)),
+ {string:to_lower(string:strip(Name)),
mochiweb_util:parse_header(Value)}.
read_chunk(Req, Length) when Length > 0 ->
Modified: couchdb/trunk/src/mochiweb/mochiweb_util.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochiweb_util.erl?rev=806513&r1=806512&r2=806513&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochiweb_util.erl (original)
+++ couchdb/trunk/src/mochiweb/mochiweb_util.erl Fri Aug 21 11:54:24 2009
@@ -12,7 +12,6 @@
-export([shell_quote/1, cmd/1, cmd_string/1, cmd_port/2]).
-export([record_to_proplist/2, record_to_proplist/3]).
-export([safe_relative_path/1, partition/2]).
--export([to_lower/1]).
-export([test/0]).
-define(PERCENT, 37). % $\%
@@ -239,7 +238,7 @@
urlsplit_scheme([], Acc) ->
{"", lists:reverse(Acc)};
urlsplit_scheme(":" ++ Rest, Acc) ->
- {to_lower(lists:reverse(Acc)), Rest};
+ {string:to_lower(lists:reverse(Acc)), Rest};
urlsplit_scheme([C | Rest], Acc) ->
urlsplit_scheme(Rest, [C | Acc]).
@@ -391,11 +390,11 @@
%% Skip anything with no value
Acc;
{Name, [$\= | Value]} ->
- [{to_lower(string:strip(Name)),
+ [{string:to_lower(string:strip(Name)),
unquote_header(string:strip(Value))} | Acc]
end
end,
- {to_lower(Type),
+ {string:to_lower(Type),
lists:foldr(F, [], Parts)}.
unquote_header("\"" ++ Rest) ->
@@ -438,20 +437,6 @@
shell_quote([C | Rest], Acc) ->
shell_quote(Rest, [C | Acc]).
-to_lower_char(C) when is_integer(C), C >= $A, C =< $Z ->
- C + 32;
-to_lower_char(C) when is_integer(C), C >= 16#C1, C =< 16#D6 ->
- C + 32;
-to_lower_char(C) when is_integer(C), C >= 16#D8, C =< 16#DE ->
- C + 32;
-to_lower_char(C) ->
- C.
-
-to_lower(S) when is_list(S) ->
- [to_lower_char(C) || C <- S];
-to_lower(C) when is_integer(C) ->
- to_lower_char(C).
-
test() ->
test_join(),
test_quote_plus(),