wcrisman
bd3e9ac5cc
Changed code in SocketContext.writeClientBoundSslMessage() to sync it up with the master branch (they are now identical (or nearly).
2014-12-28 17:45:22 -08:00
wcrisman
eb3574bb3f
Made AbstractSocketContext.id private and added an accessor to help merge code between branches. Modified WebServer.debug to be private with a public accessor to make code mergable between branches. Fixed code in NetworkListener and SocketContext to use accessors instead of attributes for id and debug. Modified SocketContext.writeClientBoundSslMessage() to take the channel and currentOutboundMessage as parameters to make code more mergable, and added debug output from main branch. Removed calls in the SSL code to chain buffers in a MessageBuffer, which should not be used currently anyway, and won't be used in the future.
2014-12-28 17:15:57 -08:00
wcrisman
d1d5671229
Fixed bug in the internalProcessResponses() in SocketContext where a message was flagged as needing to send more data because of already encrypted but unsent data, but was not properly sending the data because the currentOutboundMessage was closed and cleared.
2014-12-28 17:09:06 -08:00
wcrisman
0c3b7d026b
Fixed bug in MessageBuffer to close the buffer instead of just setting buffer = null. Modified MessageBuffer to close the response if closed its self. Modified SocketContext to get rid of the response linked list, and close the outbound message instead of the response (no more references to Response). Modified SocketContext to immediately create a MessageBuffer from a Response that is ready to be sent, and set it as the currentOutboundMessage (no list or linked list used currently). Modified writeSessionCookies() and prepareResponse() in SocketContext to take the Response as a parameter.
2014-12-28 16:03:49 -08:00
wcrisman
a9a0e799e2
Short circuited the response linked list since it shouldn't be being used.
2014-12-28 14:52:24 -08:00
wcrisman
7a75ba30de
Split sending message code into SSL and plain.
2014-12-28 14:48:03 -08:00
wcrisman
7f4d6702a0
Revert "Modified SocketContext to use a queue and an active reference to the outbound messages instead of multiple linked lists."
...
This reverts commit 06cbff7cf0 .
2014-12-28 14:38:27 -08:00
wcrisman
06cbff7cf0
Modified SocketContext to use a queue and an active reference to the outbound messages instead of multiple linked lists.
2014-12-28 10:43:25 -08:00
wcrisman
3e1a531fc3
Separated inner classes from WebServer.
2014-12-28 09:32:25 -08:00
wcrisman
ba35deff06
Revert "Switched to using HttpMessageBuffer in the code and moved the code from prepareResponse into initialize."
...
This reverts commit c36467d172 .
2014-12-26 10:17:33 -08:00
wcrisman
6c9931d4f9
Revert "Simplified writeOutgoingMessages() and removed the call to internalProcessResponses(). Likely bugs in writeClientBoundMessage()."
...
This reverts commit 29ade9b7b0 .
2014-12-26 10:17:15 -08:00
wcrisman
72fa63028e
Revert "Fixed bugs in writeClientBoundMessage."
...
This reverts commit a30fcb4002 .
2014-12-26 10:16:49 -08:00
wcrisman
7152465730
Revert "Updated/Fixed queueOutboundClientMessage(..), sendHttpResponse(..), and hasPendingWrite()."
...
This reverts commit 48724e445c .
2014-12-26 09:28:37 -08:00
wcrisman
48724e445c
Updated/Fixed queueOutboundClientMessage(..), sendHttpResponse(..), and hasPendingWrite().
2014-12-10 17:51:41 -08:00
wcrisman
a30fcb4002
Fixed bugs in writeClientBoundMessage.
2014-12-10 17:07:47 -08:00
wcrisman
29ade9b7b0
Simplified writeOutgoingMessages() and removed the call to internalProcessResponses(). Likely bugs in writeClientBoundMessage().
2014-12-10 16:31:22 -08:00
wcrisman
c36467d172
Switched to using HttpMessageBuffer in the code and moved the code from prepareResponse into initialize.
2014-12-10 14:37:55 -08:00
wcrisman
d00638873b
Applied some of the changes to the structure of WebServer that were least controversial. Some of the code added is not yet used.
2014-12-08 17:23:59 -08:00
wcrisman
acbae41318
Reversed that last change which did cause a bug (but not the bug unfortunately), and implemented the last change which might cause issues.
2014-12-07 21:40:13 -08:00
wcrisman
6bd73c6875
Removed commented old code. Made one more minor change that might break things.
2014-12-07 21:24:32 -08:00
wcrisman
b6b8de62fb
Commented out all the flagging code, leaving two possible bits of code that could cause an error.
2014-12-07 21:19:05 -08:00
wcrisman
866e8d8bbd
Switched the WebServer to detecting which flags to apply to a socket based on whether there is a pending write or remaining byte in the encrypted write buffer (likely a cause of the bug).
2014-12-07 20:33:18 -08:00
wcrisman
d0360ad252
Merged as many changes as possible in WebServer from the master branch without including any that would likely cause problems.
2014-12-07 20:19:51 -08:00
wcrisman
3d08ad5810
Added a few more changes into the mix. Only changes left are in WebServer.
2014-12-07 18:38:04 -08:00
wcrisman
ae1de97e91
Fixed compile errors by transferring more of the changes to this new branch. Previous upload doesn't compile.
2014-12-07 18:34:03 -08:00
wcrisman
2adcfad863
Merged many of the changes from the first attempt at an HTML5 Websocket implementation. Focused on the ones that didn't change the behavior of the web server.
2014-12-07 16:12:29 -08:00
wcrisman
46df41d433
Added debug output showing the message header for a HTTP message that failed to be read.
2014-09-17 09:49:04 -07:00
wcrisman
b48e81bfe0
Added exception handling in the main loop for the web server to avoid the main loop thread getting killed off due to an unexpected/unhandled exception.
...
Moved code for JSON handling and metadata/metadata container into the Common project from the Foundation project.
2014-09-16 14:01:31 -07:00
wcrisman
1a8fd62dd8
Modified the web server to use a dedicated thread to handle socket management. It now will setup new sockets, and pass request and response handling for each socket needing it to a runnable run through the thread service. This may impact performance (not sure which direction) and will ensure that socket listening is never dropped in favor of message processing.
2014-08-30 17:28:58 -07:00
wcrisman
fa572dae03
Modified ThreadService & Scheduler to allow the web server to pass a delegate service such that all webapps will use one service for each function (reduction in threading and debug complexity).
2014-08-30 15:43:30 -07:00
wcrisman
fba1f9f9b3
Re-added the clearing of SocketContext's request reference since it was causing problems with future requests.
2014-07-30 23:39:57 -07:00
wcrisman
12d99f8b4d
Removed dead code.
...
Change to WebServer's listener code to ensure that there is always a thread listening (we somehow ended up with no thread listening in some cases).
2014-07-30 23:21:05 -07:00
wcrisman
cd0976ea2e
Ensured the NPE should never again happen by accessing the request from the response instead of from the socket context.
2014-07-27 22:13:01 -07:00
wcrisman
164841677b
Fixed NPE due to request being cleared before it should be since we now don't send the response immediately back on the socket, but rather on another socket listener thread.
2014-07-27 22:10:16 -07:00
wcrisman
0b5e458dff
Removed double lock requirement for pass through sockets.
2014-07-27 22:04:42 -07:00
wcrisman
b0ae8b7e72
Merge branch 'master' of http://192.168.2.29:8990/r/Brainstorm
2014-07-18 17:21:36 -07:00
wcrisman
1cb59ffa71
Added clear to the socket read buffer to ensure it is in a writeable state.
2014-07-18 17:21:12 -07:00
Wynne Crisman
f5aa28e604
Fixed socket flagging bug that threw exceptions when flagging to read/write to a socket that has closed.
2014-07-18 17:14:13 -07:00
wcrisman
7522497634
Reverted last change and removed new code completely (wasn't working - no reason to figure out why since it was now more complicated than the code it intended to clean up).
2014-07-18 14:50:21 -07:00
wcrisman
1147864416
Re-enabled the old code with the new fix for the SSL failure.
2014-07-18 14:30:59 -07:00
wcrisman
06b0525f6d
Added check for key validity before changing interestOps to avoid pointless exception.
...
Modified message buffering code to not load the next message to be sent if we are waiting for more content from the current message (currently shouldn't happen).
2014-07-18 14:23:16 -07:00
wcrisman
2a6f2f959e
Rolled back changes to WebServer because they were causing some issues with SSL. Should investigate why the issues are occurring since the newer code should be more correct.
...
Modified build.xml (ant) to clean before any rebuild all due to having some inconsistency issues in the build.
2014-07-18 12:50:29 -07:00
Wynne Crisman
b7a830e6ae
Stopped tracking generated files; Ignored all webapp caches.
2014-07-17 14:50:19 -07:00
wcrisman
3cf6011121
Fixed bug in stopping the ThreadCreator when shutting down the ThreadService.
2014-07-17 14:28:08 -07:00
wcrisman
499a70091b
A hail mary to fix the deadlocking of request/responses in https over the internet (slow connections). Not sure if this will work at all.
...
Tried to fix the null target exception (very strange since it should be possible) in the ThreadService.
2014-07-17 12:19:22 -07:00
wcrisman
c48c065265
Modified WebServer to clean up the threading of socket communications: Made all communications via a socket (in or out) and via a linked pair of sockets (in or out of either when forwarding requests and responses to a remote server) single threaded; Attempted to clean up the way the socket listener flags are set.
...
Cleaned up ignored resources in the Brainstorm WebServer project by removing them from the repository.
2014-07-17 12:15:07 -07:00
wcrisman
edf8748a3c
Stopped tracking the webapp related files in the web server project.
2014-07-16 13:15:36 -07:00
wcrisman
645a8c0a4b
Attempted a different fix to the streamed content code so that it is blocking (previous fix failed for an unknown reason, and the code was getting complex unnecessarily).
2014-07-13 13:46:29 -07:00
wcrisman
2fc70088c1
Fixed newly introduced bug where by a blocking channel deadlocks because all content was read, but we attempted to read more anyway.
2014-07-13 12:54:10 -07:00
wcrisman
11b75d567f
Fixed bugs in web server's handling of streamed content (logic was incorrectly handling non-blocking IO in the stream - interpreting it as a stream closed). Modified StreamedContent to use blocking IO instead of non-blocking since it was wasting CPU cycles (non-blocking IO done properly would require removing the write flag from the client socket and listening to the StreamedContent for the availablity of content before re-flagging the socket for writing). Using non-blocking IO here really isn't that useful since the content source should be trusted and timely, and multiple threads service clients (a few threads blocking for a few milliseconds is no big deal), and implementing it properly would significantly increase code complexity.
2014-07-13 12:19:30 -07:00