From a9a0e799e2c56a79ad8c0c388c78434e4ee5fbc9 Mon Sep 17 00:00:00 2001 From: wcrisman Date: Sun, 28 Dec 2014 14:52:24 -0800 Subject: [PATCH] Short circuited the response linked list since it shouldn't be being used. --- .../foundation/web/server/SocketContext.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Foundation Web Core/src/com/foundation/web/server/SocketContext.java b/Foundation Web Core/src/com/foundation/web/server/SocketContext.java index bb09d9a..9fc762b 100644 --- a/Foundation Web Core/src/com/foundation/web/server/SocketContext.java +++ b/Foundation Web Core/src/com/foundation/web/server/SocketContext.java @@ -533,18 +533,21 @@ private void prepareResponse() { * @result Whether request is in a receive state. Will be false if the request generated a response that could not be completely transmitted. */ public synchronized boolean sendHttpResponse(Response response) { - if(currentResponse != null) { - lastResponse.setNextResponse(response); - lastResponse = response; - }//if// - else { - lastResponse = currentResponse = response; - sentBytes = 0; - prepareResponse(); - - //Note: Not going to process the response on this thread. Allow the flag to be set for writing to the socket, and have the next thread in the network listener handle the write. This allows for cleaner code and pipelining without all the synchronizing. -// result = internalProcessResponses(); - }//else// + //Short circuit the response linked list since it shouldn't be being used.// + lastResponse = currentResponse = response; + prepareResponse(); +// if(currentResponse != null) { +// lastResponse.setNextResponse(response); +// lastResponse = response; +// }//if// +// else { +// lastResponse = currentResponse = response; +// sentBytes = 0; +// prepareResponse(); +// +// //Note: Not going to process the response on this thread. Allow the flag to be set for writing to the socket, and have the next thread in the network listener handle the write. This allows for cleaner code and pipelining without all the synchronizing. +//// result = internalProcessResponses(); +// }//else// request = null;