You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/09/10 19:07:22 UTC
[GitHub] [couchdb] rnewson opened a new pull request #3145: Fix buffer_response=true
rnewson opened a new pull request #3145:
URL: https://github.com/apache/couchdb/pull/3145
We need to call StartFun as it might add headers, etc.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson merged pull request #3145: Fix buffer_response=true
Posted by GitBox <gi...@apache.org>.
rnewson merged pull request #3145:
URL: https://github.com/apache/couchdb/pull/3145
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] davisp commented on a change in pull request #3145: Fix buffer_response=true
Posted by GitBox <gi...@apache.org>.
davisp commented on a change in pull request #3145:
URL: https://github.com/apache/couchdb/pull/3145#discussion_r486642219
##########
File path: src/chttpd/src/chttpd.erl
##########
@@ -855,13 +855,19 @@ end_delayed_json_response(#delayed_resp{buffer_response=false}=DelayedResp) ->
end_delayed_json_response(#delayed_resp{buffer_response=true}=DelayedResp) ->
#delayed_resp{
+ start_fun = StartFun,
req = Req,
code = Code,
headers = Headers,
chunks = Chunks
} = DelayedResp,
- {ok, Resp} = start_response_length(Req, Code, Headers, iolist_size(Chunks)),
- send(Resp, lists:reverse(Chunks)).
+ {ok, Resp} = StartFun(Req, Code, Headers),
+ lists:foreach(
+ fun
+ ("") -> ok;
+ (Chunk) -> send_chunk(Resp, Chunk)
+ end, lists:reverse(Chunks)),
Review comment:
This formatting is kinda weird. Mebbe something like such?
```erlang
lists:foreach(fun
([]) -> ok;
(Chunk) -> send_chunk(Resp, Chunk)
end, lists:reverse(Chunks)),
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org