Skip to content

Commit

Permalink
Releasing version 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyCI committed Jun 30, 2020
1 parent 7ce822e commit f1963a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this package will be documented in this file.

## [1.3.1] - 2020-06-29
### Fixed:
- Incorporated [a fix](https://github.com/EventSource/eventsource/pull/130) from the upstream repository that avoids unnecessary delays when parsing a long message that is received in multiple chunks.

## [1.3.0] - 2020-04-23
### Added:
- A Node.js `http.Agent` can be specified using the `agent` option.
Expand Down
11 changes: 9 additions & 2 deletions example/eventsource-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -6666,6 +6666,8 @@ function EventSource (url, eventSourceInitDict) {
// Source/WebCore/page/EventSource.cpp
var isFirst = true
var buf
var startingPos = 0
var startingFieldLength = -1
res.on('data', function (chunk) {
buf = buf ? Buffer.concat([buf, chunk]) : chunk
if (isFirst && hasBom(buf)) {
Expand All @@ -6685,10 +6687,10 @@ function EventSource (url, eventSourceInitDict) {
}

var lineLength = -1
var fieldLength = -1
var fieldLength = startingFieldLength
var c

for (var i = pos; lineLength < 0 && i < length; ++i) {
for (var i = startingPos; lineLength < 0 && i < length; ++i) {
c = buf[i]
if (c === colon) {
if (fieldLength < 0) {
Expand All @@ -6703,7 +6705,12 @@ function EventSource (url, eventSourceInitDict) {
}

if (lineLength < 0) {
startingPos = length - pos
startingFieldLength = fieldLength
break
} else {
startingPos = 0
startingFieldLength = -1
}

parseEventStreamLine(buf, pos, fieldLength, lineLength)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "launchdarkly-eventsource",
"version": "1.3.0",
"version": "1.3.1",
"description": "Fork of eventsource package - W3C compliant EventSource client for Node.js and browser (polyfill)",
"keywords": [
"eventsource",
Expand Down

0 comments on commit f1963a7

Please sign in to comment.