[Webkit-unassigned] [Bug 68833] Discard event data not followed by an empty line before eof when parsing an event-stream
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 27 09:16:06 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=68833
Per-Erik Brodin <per-erik.brodin at ericsson.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #108722|0 |1
is obsolete| |
Attachment #108722|review? |
Flag| |
Attachment #108858| |review?
Flag| |
--- Comment #7 from Per-Erik Brodin <per-erik.brodin at ericsson.com> 2011-09-27 09:16:06 PST ---
Created an attachment (id=108858)
--> (https://bugs.webkit.org/attachment.cgi?id=108858&action=review)
updated patch
(In reply to comment #6)
> (From update of attachment 108722 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=108722&action=review
>
> I see, that explains why we need two member variables.
>
> Would "m_currentlyParsedEventId" and "m_latestCompleteEventId" work? You could also null out m_currentlyParsedEventId after transferring its value to m_latestCompleteEventId.
I would really like to leave m_lastEventId as it is since that's a name used in the spec and the lastEventId property on MessageEvent and the Last-Event-ID request header are set from it, but I've renamed m_eventId to m_currentlyParsedEventId to better reflect how it's used.
> > Source/WebCore/page/EventSource.cpp:319
> > + if (!m_eventId.isNull())
> > + m_lastEventId = m_eventId;
>
> What will break if this if() check is removed?
If the EventSource reconnects and data is discarded, and the first event after reconnecting doesn't contain an 'id' field, then m_lastEventId will be incorrectly overwritten without that if() check. I've slightly updated the eventsource-reconnect test so that this case is covered by the tests.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list