Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 05, 2012
Robert Newson Add ejje for bigcouch+ b85026c
Commits on May 02, 2012
Robert Newson Include line number in json_stack if possible
In R15 onwards, stack trace elements changed from;

{Module, Function, Arguments}
to;
{Module, Function, Arguments, Location}

where Location is a proplists with file and line items.

This patch includes the value of line if present and fixes the
fall-through to "Bad entry in stacktrace" for everything else.

BugzID: 13471
7d3055e
Commits on Jun 19, 2012
Robert Newson Add search 2.0 endpoints 859c23c
Showing with 20 additions and 8 deletions.
  1. +20 −8 src/chttpd.erl
View
28 src/chttpd.erl
@@ -339,7 +339,8 @@ db_url_handlers() ->
{<<"_design">>, fun chttpd_db:handle_design_req/2},
{<<"_temp_view">>, fun chttpd_view:handle_temp_view_req/2},
{<<"_changes">>, fun chttpd_db:handle_changes_req/2},
- {<<"_search">>, fun chttpd_external:handle_search_req/2}
+ {<<"_search">>, fun ejje_httpd:handle_search_req/2},
+ {<<"_search_cleanup">>, fun dreyfus_httpd:handle_cleanup_req/2}
].
design_url_handlers() ->
@@ -349,7 +350,9 @@ design_url_handlers() ->
{<<"_list">>, fun chttpd_show:handle_view_list_req/3},
{<<"_update">>, fun chttpd_show:handle_doc_update_req/3},
{<<"_info">>, fun chttpd_db:handle_design_info_req/3},
- {<<"_rewrite">>, fun chttpd_rewrite:handle_rewrite_req/3}
+ {<<"_rewrite">>, fun chttpd_rewrite:handle_rewrite_req/3},
+ {<<"_search">>, fun dreyfus_httpd:handle_search_req/3},
+ {<<"_search_info">>, fun dreyfus_httpd:handle_info_req/3}
].
% Utilities
@@ -772,11 +775,20 @@ reqid() ->
{"X-Couch-Request-ID", get(nonce)}.
json_stack({_Error, _Reason, Stack}) ->
- lists:map(fun({M,F,A0}) ->
- A = if is_integer(A0) -> A0; is_list(A0) -> length(A0); true -> 0 end,
- list_to_binary(io_lib:format("~s:~s/~B", [M,F,A]));
- (_) ->
- <<"bad entry in stacktrace">>
- end, Stack);
+ lists:map(fun json_stack_item/1, Stack);
json_stack(_) ->
[].
+
+json_stack_item({M,F,A}) ->
+ list_to_binary(io_lib:format("~s:~s/~B", [M, F, json_stack_arity(A)]));
+json_stack_item({M,F,A,L}) ->
+ case proplists:get_value(line, L) of
+ undefined -> json_stack_item({M,F,A});
+ Line -> list_to_binary(io_lib:format("~s:~s/~B L~B",
+ [M, F, json_stack_arity(A), Line]))
+ end;
+json_stack_item(_) ->
+ <<"bad entry in stacktrace">>.
+
+json_stack_arity(A) ->
+ if is_integer(A) -> A; is_list(A) -> length(A); true -> 0 end.

No commit comments for this range

Something went wrong with that request. Please try again.