You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2012/11/09 18:12:12 UTC
[3/4] git commit: Allow any 2xx code to indicate success
Allow any 2xx code to indicate success
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a124976e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a124976e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a124976e
Branch: refs/heads/1.3.x
Commit: a124976efa12b5b060f61f93ad3f58dc1986166d
Parents: b9af7ea
Author: Robert Newson <rn...@apache.org>
Authored: Thu Nov 8 15:32:14 2012 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Nov 8 15:32:22 2012 +0000
----------------------------------------------------------------------
.../src/couch_replicator_httpc.erl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a124976e/src/couch_replicator/src/couch_replicator_httpc.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl b/src/couch_replicator/src/couch_replicator_httpc.erl
index 8773383..9c23595 100644
--- a/src/couch_replicator/src/couch_replicator_httpc.erl
+++ b/src/couch_replicator/src/couch_replicator_httpc.erl
@@ -80,7 +80,7 @@ process_response({ibrowse_req_id, ReqId}, Worker, HttpDb, Params, Callback) ->
process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params, Callback) ->
release_worker(Worker, HttpDb),
case list_to_integer(Code) of
- Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
+ Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) ->
EJson = case Body of
<<>> ->
null;
@@ -102,7 +102,7 @@ process_stream_response(ReqId, Worker, HttpDb, Params, Callback) ->
receive
{ibrowse_async_headers, ReqId, Code, Headers} ->
case list_to_integer(Code) of
- Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
+ Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) ->
StreamDataFun = fun() ->
stream_data_self(HttpDb, Params, Worker, ReqId, Callback)
end,
Re: [3/4] git commit: Allow any 2xx code to indicate success
Posted by Benoit Chesneau <bc...@gmail.com>.
ah cool :) Thanks for the info.
- benoƮt
On Fri, Nov 9, 2012 at 6:45 PM, Robert Newson <ro...@gmail.com> wrote:
> Interop with bigcouch when it sends a 202. I just make it more generic to
> head off the inevitable next bug. :)
>
>
> On 9 November 2012 17:38, Benoit Chesneau <bc...@gmail.com> wrote:
>
>> just curious what does it solves?
>>
>> On Fri, Nov 9, 2012 at 6:12 PM, <rn...@apache.org> wrote:
>> > Allow any 2xx code to indicate success
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a124976e
>> > Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a124976e
>> > Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a124976e
>> >
>> > Branch: refs/heads/1.3.x
>> > Commit: a124976efa12b5b060f61f93ad3f58dc1986166d
>> > Parents: b9af7ea
>> > Author: Robert Newson <rn...@apache.org>
>> > Authored: Thu Nov 8 15:32:14 2012 +0000
>> > Committer: Robert Newson <rn...@apache.org>
>> > Committed: Thu Nov 8 15:32:22 2012 +0000
>> >
>> > ----------------------------------------------------------------------
>> > .../src/couch_replicator_httpc.erl | 4 ++--
>> > 1 files changed, 2 insertions(+), 2 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/a124976e/src/couch_replicator/src/couch_replicator_httpc.erl
>> > ----------------------------------------------------------------------
>> > diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl
>> b/src/couch_replicator/src/couch_replicator_httpc.erl
>> > index 8773383..9c23595 100644
>> > --- a/src/couch_replicator/src/couch_replicator_httpc.erl
>> > +++ b/src/couch_replicator/src/couch_replicator_httpc.erl
>> > @@ -80,7 +80,7 @@ process_response({ibrowse_req_id, ReqId}, Worker,
>> HttpDb, Params, Callback) ->
>> > process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params,
>> Callback) ->
>> > release_worker(Worker, HttpDb),
>> > case list_to_integer(Code) of
>> > - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
>> > + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500)
>> ->
>> > EJson = case Body of
>> > <<>> ->
>> > null;
>> > @@ -102,7 +102,7 @@ process_stream_response(ReqId, Worker, HttpDb,
>> Params, Callback) ->
>> > receive
>> > {ibrowse_async_headers, ReqId, Code, Headers} ->
>> > case list_to_integer(Code) of
>> > - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500)
>> ->
>> > + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok <
>> 500) ->
>> > StreamDataFun = fun() ->
>> > stream_data_self(HttpDb, Params, Worker, ReqId,
>> Callback)
>> > end,
>> >
>>
Re: [3/4] git commit: Allow any 2xx code to indicate success
Posted by Robert Newson <ro...@gmail.com>.
Interop with bigcouch when it sends a 202. I just make it more generic to
head off the inevitable next bug. :)
On 9 November 2012 17:38, Benoit Chesneau <bc...@gmail.com> wrote:
> just curious what does it solves?
>
> On Fri, Nov 9, 2012 at 6:12 PM, <rn...@apache.org> wrote:
> > Allow any 2xx code to indicate success
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a124976e
> > Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a124976e
> > Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a124976e
> >
> > Branch: refs/heads/1.3.x
> > Commit: a124976efa12b5b060f61f93ad3f58dc1986166d
> > Parents: b9af7ea
> > Author: Robert Newson <rn...@apache.org>
> > Authored: Thu Nov 8 15:32:14 2012 +0000
> > Committer: Robert Newson <rn...@apache.org>
> > Committed: Thu Nov 8 15:32:22 2012 +0000
> >
> > ----------------------------------------------------------------------
> > .../src/couch_replicator_httpc.erl | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/a124976e/src/couch_replicator/src/couch_replicator_httpc.erl
> > ----------------------------------------------------------------------
> > diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl
> b/src/couch_replicator/src/couch_replicator_httpc.erl
> > index 8773383..9c23595 100644
> > --- a/src/couch_replicator/src/couch_replicator_httpc.erl
> > +++ b/src/couch_replicator/src/couch_replicator_httpc.erl
> > @@ -80,7 +80,7 @@ process_response({ibrowse_req_id, ReqId}, Worker,
> HttpDb, Params, Callback) ->
> > process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params,
> Callback) ->
> > release_worker(Worker, HttpDb),
> > case list_to_integer(Code) of
> > - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
> > + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500)
> ->
> > EJson = case Body of
> > <<>> ->
> > null;
> > @@ -102,7 +102,7 @@ process_stream_response(ReqId, Worker, HttpDb,
> Params, Callback) ->
> > receive
> > {ibrowse_async_headers, ReqId, Code, Headers} ->
> > case list_to_integer(Code) of
> > - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500)
> ->
> > + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok <
> 500) ->
> > StreamDataFun = fun() ->
> > stream_data_self(HttpDb, Params, Worker, ReqId,
> Callback)
> > end,
> >
>
Re: [3/4] git commit: Allow any 2xx code to indicate success
Posted by Benoit Chesneau <bc...@gmail.com>.
just curious what does it solves?
On Fri, Nov 9, 2012 at 6:12 PM, <rn...@apache.org> wrote:
> Allow any 2xx code to indicate success
>
>
> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a124976e
> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a124976e
> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a124976e
>
> Branch: refs/heads/1.3.x
> Commit: a124976efa12b5b060f61f93ad3f58dc1986166d
> Parents: b9af7ea
> Author: Robert Newson <rn...@apache.org>
> Authored: Thu Nov 8 15:32:14 2012 +0000
> Committer: Robert Newson <rn...@apache.org>
> Committed: Thu Nov 8 15:32:22 2012 +0000
>
> ----------------------------------------------------------------------
> .../src/couch_replicator_httpc.erl | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/a124976e/src/couch_replicator/src/couch_replicator_httpc.erl
> ----------------------------------------------------------------------
> diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl b/src/couch_replicator/src/couch_replicator_httpc.erl
> index 8773383..9c23595 100644
> --- a/src/couch_replicator/src/couch_replicator_httpc.erl
> +++ b/src/couch_replicator/src/couch_replicator_httpc.erl
> @@ -80,7 +80,7 @@ process_response({ibrowse_req_id, ReqId}, Worker, HttpDb, Params, Callback) ->
> process_response({ok, Code, Headers, Body}, Worker, HttpDb, Params, Callback) ->
> release_worker(Worker, HttpDb),
> case list_to_integer(Code) of
> - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
> + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) ->
> EJson = case Body of
> <<>> ->
> null;
> @@ -102,7 +102,7 @@ process_stream_response(ReqId, Worker, HttpDb, Params, Callback) ->
> receive
> {ibrowse_async_headers, ReqId, Code, Headers} ->
> case list_to_integer(Code) of
> - Ok when Ok =:= 200 ; Ok =:= 201 ; (Ok >= 400 andalso Ok < 500) ->
> + Ok when (Ok >= 200 andalso Ok < 300) ; (Ok >= 400 andalso Ok < 500) ->
> StreamDataFun = fun() ->
> stream_data_self(HttpDb, Params, Worker, ReqId, Callback)
> end,
>