Repository: asterixdb
Updated Branches:
  refs/heads/master e5c4528d0 -> f0759c85b


ASTERIXDB-1939: No chunked encoding with content-length.

Change-Id: I06d561eb023f1c84c531e9b2cfe88a626d7e5280
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1632
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/f0759c85
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/f0759c85
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/f0759c85

Branch: refs/heads/master
Commit: f0759c85b70d18fe9376cdc034ed9e70e1ec0c74
Parents: e5c4528
Author: Till Westmann <ti...@apache.org>
Authored: Sat Jun 10 20:35:10 2017 -0700
Committer: Till Westmann <ti...@apache.org>
Committed: Sat Jun 10 23:03:59 2017 -0700

----------------------------------------------------------------------
 .../hyracks/control/cc/web/ApplicationInstallationHandler.java     | 1 +
 .../main/java/org/apache/hyracks/http/server/ChunkedResponse.java  | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f0759c85/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
----------------------------------------------------------------------
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
index 9745091..2b0382b 100755
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
@@ -71,6 +71,7 @@ public class ApplicationInstallationHandler extends 
AbstractServlet {
                 : rootDir + File.separator + "/applications/" + File.separator 
+ deployIdString;
         final HttpMethod method = request.getHttpRequest().method();
         try {
+            response.setStatus(HttpResponseStatus.OK);
             if (method == HttpMethod.PUT) {
                 final ByteBuf content = request.getHttpRequest().content();
                 writeToFile(content, deploymentDir, fileName);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f0759c85/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
----------------------------------------------------------------------
diff --git 
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
 
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
index 1d219ba..8fd444b 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/ChunkedResponse.java
@@ -164,6 +164,8 @@ public class ChunkedResponse implements IServletResponse {
     private void fullResponse(HttpVersion version, HttpResponseStatus status, 
ByteBuf buffer, HttpHeaders headers) {
         DefaultFullHttpResponse fullResponse = new 
DefaultFullHttpResponse(version, status, buffer);
         fullResponse.headers().set(headers);
+        // for a full response remove chunked transfer-encoding and set the 
content length instead
+        fullResponse.headers().remove(HttpHeaderNames.TRANSFER_ENCODING);
         fullResponse.headers().setInt(HttpHeaderNames.CONTENT_LENGTH, 
buffer.readableBytes());
         future = ctx.writeAndFlush(fullResponse);
         headerSent = true;

Reply via email to