Closed Bug 662073 Opened 13 years ago Closed 11 years ago

Fix minor Server-Sent Events issues

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: wfernandom2004, Assigned: wfernandom2004)

References

Details

Attachments

(2 files, 2 obsolete files)

Attached file test results (obsolete) —
Opera has tests which fail in our implementation. The attachment compares the results of those tests when running them on Opera, Chrome and our implementation.
Assignee: nobody → wfernandom2004
Status: NEW → ASSIGNED
Attached patch patch v1Splinter Review
Attachment #546326 - Flags: review?(Olli.Pettay)
Attached file test results (obsolete) —
Only request-status-error.htm is failing. However I think our implementation is correct.
Attachment #537373 - Attachment is obsolete: true
Could you perhaps attach the test results in some other form?
Comment on attachment 546326 [details] [diff] [review]
patch v1

>diff --git a/content/base/src/nsEventSource.cpp b/content/base/src/nsEventSource.cpp
>--- a/content/base/src/nsEventSource.cpp
>+++ b/content/base/src/nsEventSource.cpp
>@@ -475,16 +475,25 @@ nsEventSource::StreamReaderFunc(nsIInput
> 
>   PRInt32 srcCount, outCount;
>   PRUnichar out[2];
>   nsresult rv;
> 
>   const char *p = aFromRawSegment,
>              *end = aFromRawSegment + aCount;
> 
>+  // If we have more than one BOM char at the begin of the stream then
beginning of...
>+  // the converter will leave only one. So we handle the first BOM here instead
>+  // of inside nsEventSource::ParseCharacter(). See bug 662073.
>+  if (thisObject->mStatus == PARSE_STATE_BEGIN_OF_STREAM && aCount >= 2 &&
>+      static_cast<PRUnichar>(*p) == BOM_CHAR) {
>+    thisObject->mStatus = PARSE_STATE_BOM_WAS_READ;  // ignore it
>+    p += 2;
>+  }
>+

r=me if you add tests.
Attachment #546326 - Flags: review?(Olli.Pettay) → review+
> r=me if you add tests.
Perhaps I could rewrite the Opera tests to Mochitest. Do you still have the url address of the Opera's php test sources?
Also, because I'm not an expert on laws, do we have license to rewrite the tests?
Anne said it is ok to reuse the tests. No need to add any license text.
Attached file test results
Attachment #546327 - Attachment is obsolete: true
> Anne said it is ok to reuse the tests. No need to add any license text.
Please, ask them to add some written text in the sources that explicitly states which license the sources are under.
Attachment #546326 - Flags: review+ → review-
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
See Also: → 869432, 869865, 869874, 869875, 869878, 869882
Duplicated of bugs 869432, 869865, 869874, 869875, 869878 and 869882.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: