Skip to content

Commit

Permalink
chunks can contain multiple messages sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
d-led committed May 31, 2024
1 parent e3cf1ef commit 8e6dc30
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/jquery_example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,14 @@ <h2>Domain Stats</h2>
chunkAttempts++;
do {
// split individual JSON objects
var nextMessage = response.substring(messageStart);
indexOfBreak = nextMessage.indexOf('\n');
if (indexOfBreak > 0) {
var nextMessage = "";
var indexOfBreak = -1;
while(true) {
nextMessage = response.substring(messageStart);
indexOfBreak = nextMessage.indexOf('\n');
if (indexOfBreak === -1) {
break;
}
urlSubstring = nextMessage.substring(0, indexOfBreak);
messageStart = messageStart + indexOfBreak + 1;

Expand Down

0 comments on commit 8e6dc30

Please sign in to comment.