aboutsummaryrefslogtreecommitdiffstats
path: root/WebContent
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2013-07-17 11:44:57 +0200
committerVaadin Code Review <review@vaadin.com>2013-08-01 10:03:34 +0000
commit326bbb5e91564a39553b13f5a3a00b7ff5dd40ec (patch)
tree88a14751fc5de72c0d912bca0f9b806e4e127773 /WebContent
parentea148c80ea6e12860a646bfaf60a0b712ebc8958 (diff)
downloadvaadin-framework-326bbb5e91564a39553b13f5a3a00b7ff5dd40ec.tar.gz
vaadin-framework-326bbb5e91564a39553b13f5a3a00b7ff5dd40ec.zip
Fixes parsing of multiple push messages in streaming mode (#12197)
The current atmosphere code can handle messages split up using the message length header. But it does not handle the case where the header is actually split up itself. This patch solves it by making sure the length header stays intact. Corresponding atmosphere ticket: https://github.com/Atmosphere/atmosphere/issues/1199 Change-Id: If22c42ea63b0749c68df19c869b316f9b69f4317
Diffstat (limited to 'WebContent')
-rw-r--r--WebContent/VAADIN/jquery.atmosphere.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/WebContent/VAADIN/jquery.atmosphere.js b/WebContent/VAADIN/jquery.atmosphere.js
index 28a7d033bd..b2dd99f5d2 100644
--- a/WebContent/VAADIN/jquery.atmosphere.js
+++ b/WebContent/VAADIN/jquery.atmosphere.js
@@ -1219,8 +1219,15 @@ jQuery.atmosphere = function() {
messages.push(message.substring(0, messageLength));
}
- if (messages.length == 0 || (messageStart != -1 && message.length != 0 && messageLength != message.length)){
- response.partialMessage = messageLength + request.messageDelimiter + message ;
+ if (messages.length == 0 || (message.length != 0 && messageLength != message.length)){
+ if (messageStart == -1) {
+ // http://dev.vaadin.com/ticket/12197
+ // partialMessage must contain length header of next message
+ // it starts at the end of the last message
+ response.partialMessage = message.substring(messageLength);
+ } else {
+ response.partialMessage = messageLength + request.messageDelimiter + message ;
+ }
} else {
response.partialMessage = "";
}