Permalink
Browse files

Index merging now uses lhttpc instead of ibrowse

These changes are required after replacing ibrowse with
lhttpc in CouchDB's index merger.

Change-Id: Ibae8a49f7f4a26ff3993909d746479007c3d9cd5
Reviewed-on: http://review.couchbase.org/14590
Tested-by: Damien Katz <damien@couchbase.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
  • Loading branch information...
fdmanana authored and Damien Katz committed Apr 5, 2012
1 parent 3670bb9 commit e6cf87b6ca4c920800477480863a189f0f300622
Showing with 8 additions and 6 deletions.
  1. +1 −1 Makefile
  2. +3 −3 src/geocouch/couch_httpd_spatial_merger.erl
  3. +2 −2 src/geocouch/couch_spatial_merger.erl
  4. +2 −0 test/200-compact.t
View
@@ -15,7 +15,7 @@ builddir:
buildandtest: all test
runtests:
- ERL_FLAGS="-pa ${COUCH_SRC} -pa ${COUCH_SRC}/../etap -pa ${COUCH_SRC}/../snappy -pa ${COUCH_SRC}/../../test/etap -pa ${COUCH_SRC}/../couch_set_view/ebin -pa ${COUCH_SRC}/../mochiweb -pa ${COUCH_SRC}/../ibrowse -pa ${COUCH_SRC}/../erlang-oauth -pa ${COUCH_SRC}/../ejson -pa ${COUCH_SRC}/../mapreduce" prove ./test/*.t
+ ERL_FLAGS="-pa ${COUCH_SRC} -pa ${COUCH_SRC}/../etap -pa ${COUCH_SRC}/../snappy -pa ${COUCH_SRC}/../../test/etap -pa ${COUCH_SRC}/../couch_set_view/ebin -pa ${COUCH_SRC}/../mochiweb -pa ${COUCH_SRC}/../lhttpc -pa ${COUCH_SRC}/../erlang-oauth -pa ${COUCH_SRC}/../ejson -pa ${COUCH_SRC}/../mapreduce" prove ./test/*.t
check: clean builddir compileforcheck runtests
rm -rf build
@@ -16,7 +16,7 @@
-include("couch_db.hrl").
-include("couch_index_merger.hrl").
--include("../ibrowse/ibrowse.hrl").
+-include("../lhttpc/lhttpc.hrl").
-import(couch_util, [
get_value/2,
@@ -90,8 +90,8 @@ validate_spatial_param({[_ | _] = Indexes}) ->
}
end, SpatialNames);
({MergeUrl, {[_ | _] = Props} = EJson}) ->
- case (catch ibrowse_lib:parse_url(?b2l(MergeUrl))) of
- #url{} ->
+ case (catch lhttpc_lib:parse_url(?b2l(MergeUrl))) of
+ #lhttpc_url{} ->
ok;
_ ->
throw({bad_request, "Invalid spatial merge definition object."})
@@ -59,7 +59,7 @@ http_index_folder_req_details(#merged_index_spec{} = Spec, MergeParams, DDoc) ->
conn_timeout = Timeout,
http_params = SpatialArgs
} = MergeParams,
- {ok, #httpdb{url = Url, ibrowse_options = Options} = Db} =
+ {ok, #httpdb{url = Url, lhttpc_options = Options} = Db} =
couch_index_merger:open_db(MergeUrl0, nil, Timeout),
MergeUrl = Url ++ spatial_qs(SpatialArgs),
Headers = [{"Content-Type", "application/json"} | Db#httpdb.headers],
@@ -87,7 +87,7 @@ http_index_folder_req_details(#simple_index_spec{} = Spec, MergeParams, _DDoc) -
conn_timeout = Timeout,
http_params = SpatialArgs
} = MergeParams,
- {ok, #httpdb{url = Url, ibrowse_options = Options}} =
+ {ok, #httpdb{url = Url, lhttpc_options = Options}} =
couch_index_merger:open_db(DbUrl, nil, Timeout),
SpatialUrl = Url ++ ?b2l(DDocId) ++ "/_spatial/" ++ ?b2l(SpatialName) ++
spatial_qs(SpatialArgs),
View
@@ -38,6 +38,8 @@ main(_) ->
ok.
test() ->
+ ok = ssl:start(),
+ ok = lhttpc:start(),
GeoCouchConfig = filename:join(
gc_test_util:root_dir() ++ [gc_test_util:gc_config_file()]),
ConfigFiles = test_util:config_files() ++ [GeoCouchConfig],

0 comments on commit e6cf87b

Please sign in to comment.