Skip to content

Commit cd47e72

Browse files
committed
Fixed bug that notifying pipe sequence back to server does not work
correctly
1 parent 41c4b97 commit cd47e72

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,14 @@ public void run() {
341341
request.registerOnReadyStateChange(new XHRCallbackAdapter() {
342342
public void onLoaded() {
343343
String response = request.getResponseText();
344-
if (response != null && p.notifySequence < sequence && response.indexOf("$p1p3b$") != 0) {
344+
if (response == null || response.length() == 0 || response.indexOf("$p1p3b$") != 0) {
345+
// Incorrect response
346+
return;
347+
}
348+
if (p.notifySequence < sequence) {
345349
p.notifySequence = sequence;
346350
}
347-
if (response != null && response.indexOf("\"" + PIPE_STATUS_LOST + "\"") != -1) {
351+
if (response.indexOf("\"" + PIPE_STATUS_LOST + "\"") != -1) {
348352
p.pipeAlive = false;
349353
p.pipeLost();
350354
SimplePipeHelper.removePipe(pipeKey);

0 commit comments

Comments
 (0)