diff options
author | Artur Signell <artur@vaadin.com> | 2013-08-19 18:27:35 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-08-20 09:19:15 +0300 |
commit | 61dbe9caa1daee4ce2ddddc38de1ec604c464ef5 (patch) | |
tree | 151c8708c4d12ef9cb5cf484189c555b03191308 /WebContent | |
parent | 7182665fde6fdedb721ef72efd5412432b4d13a9 (diff) | |
download | vaadin-framework-61dbe9caa1daee4ce2ddddc38de1ec604c464ef5.tar.gz vaadin-framework-61dbe9caa1daee4ce2ddddc38de1ec604c464ef5.zip |
Search only remaining message for delimiter (#12404)
Change-Id: I0d61984aa795ec2b3bd384c2f93f6e3ee2a71be3
Diffstat (limited to 'WebContent')
-rw-r--r-- | WebContent/VAADIN/jquery.atmosphere.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/WebContent/VAADIN/jquery.atmosphere.js b/WebContent/VAADIN/jquery.atmosphere.js index b2dd99f5d2..b6f86d428a 100644 --- a/WebContent/VAADIN/jquery.atmosphere.js +++ b/WebContent/VAADIN/jquery.atmosphere.js @@ -1213,9 +1213,13 @@ jQuery.atmosphere = function() { messageLength = jQuery.trim(message.substring(messageLength, messageStart)); message = message.substring(messageStart + request.messageDelimiter.length, message.length); + // Stop search if there is not enough characters remaining (wait for next part to arrive) if (message.length == 0 || message.length < messageLength) break; - messageStart = message.indexOf(request.messageDelimiter); + // Find start of a possibly existing subsequent message from the remaining data + messageStart = message.substring(messageLength).indexOf(request.messageDelimiter); + + // Store the completely received message messages.push(message.substring(0, messageLength)); } |