Skip to content

Commit d8ce4f5

Browse files
committed
Make sure that pipe notify request is correctly responded from pipe
server before marking pipe sequence is notified
1 parent 938ef9b commit d8ce4f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeRequest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ public static void switchToContinuumMode() {
178178
queueNotifying = false;
179179
}
180180

181+
/**
182+
* Switch to continuum mode, specifying whether sending notify request back to server in queue or not.
183+
* @param queue If queue is true, all local pipes' notify requests are sent asynchronously. If queue
184+
* is false, notify requests are sent one by one in Pipe Live Notifier thread.
185+
*/
181186
public static void switchToContinuumMode(boolean queue) {
182187
pipeMode = MODE_PIPE_CONTINUUM;
183188
queueNotifying = queue;
@@ -333,7 +338,7 @@ public void run() {
333338
request.registerOnReadyStateChange(new XHRCallbackAdapter() {
334339
public void onLoaded() {
335340
String response = request.getResponseText();
336-
if (response != null && p.notifySequence < sequence) {
341+
if (response != null && p.notifySequence < sequence && response.indexOf("$p1p3b$") != 0) {
337342
p.notifySequence = sequence;
338343
}
339344
if (response != null && response.indexOf("\"" + PIPE_STATUS_LOST + "\"") != -1) {

0 commit comments

Comments
 (0)