private void onDone() { if (stopped) { return; } boolean willBeDone = true; if (!rendering) { renderResponseOrError(); willBeDone = false; } if (!completed) { // FIXME is this still required? completed = true; } if (response != null) { response.finish(); } if (willBeDone) { HttpIO.INSTANCE.done(ReqImpl.this); } }
private void renderResponse() { HttpUtils.postProcessResponse(response); if (response.raw() != null) { int posBeforeResponse = channel.output().size(); byte[] bytes = Msc.toBytes(response.raw()); channel.write(bytes); if (willSaveToCache()) posBeforeBody = posBeforeResponse + HttpUtils.findBodyStart(bytes); completed = true; HttpIO.INSTANCE.done(this); } else { // render the response body RespBody body = BodyRenderer.toRespBody(this, response); // render the response doRendering(response.code(), body); } }
private void onDone() { if (stopped) { return; } boolean willBeDone = true; if (!rendering) { renderResponseOrError(); willBeDone = false; } if (!completed) { // FIXME is this still required? completed = true; } if (response != null) { response.finish(); } if (willBeDone) { HttpIO.INSTANCE.done(ReqImpl.this); } }
private void renderResponse() { HttpUtils.postProcessResponse(response); if (response.raw() != null) { int posBeforeResponse = channel.output().size(); byte[] bytes = Msc.toBytes(response.raw()); channel.write(bytes); if (willSaveToCache()) posBeforeBody = posBeforeResponse + HttpUtils.findBodyStart(bytes); completed = true; HttpIO.INSTANCE.done(this); } else { // render the response body RespBody body = BodyRenderer.toRespBody(this, response); // render the response doRendering(response.code(), body); } }