summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBob Dionne <bob@cloudant.com>2011-11-22 11:42:55 -0500
committerBob Dionne <bob@cloudant.com>2011-11-22 11:42:55 -0500
commit768324cb27a7aa2c390a2d48555e9643fb793fe7 (patch)
tree733cfb3347eafa3022fcf1fbcc7bb9d06f8dc9d9 /apps
parentf2e2e77cb6b73d8a2ad0008ca2eb43c0e9363ce2 (diff)
Remove unused imports
Diffstat (limited to 'apps')
-rw-r--r--apps/couch/src/couch_httpd_db.erl22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/couch/src/couch_httpd_db.erl b/apps/couch/src/couch_httpd_db.erl
index 0bf97e26..6458fe70 100644
--- a/apps/couch/src/couch_httpd_db.erl
+++ b/apps/couch/src/couch_httpd_db.erl
@@ -20,7 +20,7 @@
-import(couch_httpd,
[send_json/2,send_json/3,send_json/4,send_method_not_allowed/2,
- send_response/4,start_json_response/2,start_json_response/3,
+ start_json_response/2,
send_chunk/2,last_chunk/1,end_json_response/1,
start_chunked_response/3, absolute_uri/2, send/2,
start_response_length/4]).
@@ -236,7 +236,7 @@ db_req(#httpd{method='POST',path_parts=[DbName]}=Req, Db) ->
?LOG_INFO("Batch doc error (~s): ~p",[DocId, Error])
end
end),
-
+
send_json(Req, 202, [], {[
{ok, true},
{id, DocId}
@@ -689,7 +689,7 @@ db_doc_req(#httpd{method='PUT'}=Req, Db, DocId) ->
update_type = UpdateType
} = parse_doc_query(Req),
couch_doc:validate_docid(DocId),
-
+
Loc = absolute_uri(Req, "/" ++ ?b2l(Db#db.name) ++ "/" ++ ?b2l(DocId)),
RespHeaders = [{"Location", Loc}],
case couch_util:to_list(couch_httpd:header_value(Req, "Content-Type")) of
@@ -711,7 +711,7 @@ db_doc_req(#httpd{method='PUT'}=Req, Db, DocId) ->
"ok" ->
% batch
Doc = couch_doc_from_req(Req, DocId, couch_httpd:json_body(Req)),
-
+
spawn(fun() ->
case catch(couch_db:update_doc(Db, Doc, [])) of
{ok, _} -> ok;
@@ -776,7 +776,7 @@ send_doc_efficiently(#httpd{mochi_req = MochiReq} = Req,
send_json(Req, 200, Headers, couch_doc:to_json_obj(Doc, Options));
true ->
Boundary = couch_uuids:random(),
- JsonBytes = ?JSON_ENCODE(couch_doc:to_json_obj(Doc,
+ JsonBytes = ?JSON_ENCODE(couch_doc:to_json_obj(Doc,
[attachments, follows, att_encoding_info | Options])),
{ContentType, Len} = couch_doc:len_doc_to_multi_part_stream(
Boundary,JsonBytes, Atts, true),
@@ -793,7 +793,7 @@ send_docs_multipart(Req, Results, Options1) ->
OuterBoundary = couch_uuids:random(),
InnerBoundary = couch_uuids:random(),
Options = [attachments, follows, att_encoding_info | Options1],
- CType = {"Content-Type",
+ CType = {"Content-Type",
"multipart/mixed; boundary=\"" ++ ?b2l(OuterBoundary) ++ "\""},
{ok, Resp} = start_chunked_response(Req, 200, [CType]),
couch_httpd:send_chunk(Resp, <<"--", OuterBoundary/binary>>),
@@ -811,8 +811,8 @@ send_docs_multipart(Req, Results, Options1) ->
({{not_found, missing}, RevId}) ->
RevStr = couch_doc:rev_to_str(RevId),
Json = ?JSON_ENCODE({[{"missing", RevStr}]}),
- couch_httpd:send_chunk(Resp,
- [<<"\r\nContent-Type: application/json; error=\"true\"\r\n\r\n">>,
+ couch_httpd:send_chunk(Resp,
+ [<<"\r\nContent-Type: application/json; error=\"true\"\r\n\r\n">>,
Json,
<<"\r\n--", OuterBoundary/binary>>])
end, Results),
@@ -848,7 +848,7 @@ receive_request_data(Req, LenLeft) when LenLeft > 0 ->
{Data, fun() -> receive_request_data(Req, LenLeft - iolist_size(Data)) end};
receive_request_data(_Req, _) ->
throw(<<"expected more data">>).
-
+
make_content_range(From, To, Len) ->
?l2b(io_lib:format("bytes ~B-~B/~B", [From, To, Len])).
@@ -1078,8 +1078,8 @@ db_attachment_req(#httpd{method=Method,mochi_req=MochiReq}=Req, Db, DocId, FileN
_Else ->
ok
end,
-
-
+
+
fun(Size) -> couch_httpd:recv(Req, Size) end
end,
att_len = case couch_httpd:header_value(Req,"Content-Length") of