[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
Mon Sep 26 15:16:51 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68833





--- Comment #5 from Per-Erik Brodin <per-erik.brodin at ericsson.com>  2011-09-26 15:16:51 PST ---
(In reply to comment #4)
> (From update of attachment 108722 [details])
> > Source/WebCore/page/EventSource.cpp:247
> > +        m_eventId = String();
> 
> We don't have a function that discards everything already?

No, since two newlines were added to m_receiveBuf before the event stream parser always ran to the end of it and did all necessary discarding.

> > Source/WebCore/page/EventSource.h:118
> > +        String m_eventId;
> >          String m_lastEventId;
> 
> I'm not thrilled about having two eventId member variables. How are they different? Maybe "last" is actually "previous"? Can we encode this bit of state somehow else, without seemingly duplicating data?

I'm not thrilled about it either. Both m_eventId and m_lastEventId represent the last 'id' field received. The difference is that m_eventId stores the value temporarily while parsing and the value isn't transferred to m_lastEventId until an event is dispatch to avoid overwriting m_lastEventId in case the 'id' field should be discarded. I couldn't come up with a better way to solve it than having two eventId members.

-- 
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