Open Bug 699791 Opened 15 years ago Updated 4 years ago

Embedding an MJPEG stream page into an iFrame triggers the file download dialog

Categories

(Core :: Networking, defect, P3)

7 Branch
x86_64
Windows 7
defect

Tracking

()

People

(Reporter: luc.traonmilin, Unassigned)

Details

(Whiteboard: [necko-backlog])

Attachments

(2 files)

Attached image Screenshot of the issue —
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2 Steps to reproduce: I use an iFrame tag to embed an MJPEG stream into a web page. Actual results: After working fine for a while, the file download dialog pops up once or more. The file type in the dialog is cgi, or application/octet-stream or Document, I assume it is related to the stream URL file extension because the server sends correct headers (multipart/x-mixed-replace). The stream still displays while the dialogs pop up. Expected results: No pop up. To reproduce the bug, simply create an iframe and use the stream URL as src (works fine in Chrome).
Is is possible that one of the parts of your stream doesn't list a Content-Type for that one part? > and use the stream URL as src Which URL? In any case, this is a multipart decoder issue or a server issue, not a frames issue...
Component: Layout: HTML Frames → Networking
QA Contact: layout.html-frames → networking
It's possible that some Content-Type fields are missing however I don't think it should affect the decoding process (unless some standard requires that): I have had instances of MJPEG streams from IP cameras whith no header fields for individual parts, only the boundaries. I will try and put together a standalone runnable test case ASAP so that we can narrow it down.
> unless some standard requires that Both standards and web compatibility require that every part of a multipart response be processed per the type for that part when loaded in an iframe. So if you have a multipart response with two parts where the first part is application/x-msword and the second part is text/html, that should open the helper application for application/x-msword with the data in the first part and render the second part in the browser. That said, even if the Content-Type is missing for part of a multipart JPEG stream, I would thing type sniffing would pick up the JPEG magic number and hence render as JPEG. If you're getting application/octet-stream out, then it sounds like some part is not only missing the Content-Type header but also has non-JPEG data, which would be pretty odd. The odds of a bug in our multipart decoder are almost higher than that... I'd really appreciate a test case if you can get one together! Something is definitely fishy here.
I investigated the issue further and came up with the following: - it is definitely not an iframe issue, it also occurs when the stream is accessed directly, - I wrote a server that generates a valid (I think so) MJPEG stream and cannot reproduce the issue, - I captured a few minutes (the issue usually happens within first minute) of the stream I have issues with (from an IP camera on a VPN), streamed it back from the same server I wrote and could not reproduce the issue either. - I ran a Wireshark session (I can upload the capture file if it helps) until issue occured, the shape of the stream looked correct so I extracted all images from capture and checked that they all display correctly (I am on a Windows 7 machine), which is the case. What can I do next?
> - it is definitely not an iframe issue, it also occurs when the stream is accessed > directly, Right. The same code runs for those cases. I would assume the exact packet boundaries in the original stream are relevant... Patrick, do we have something that would be able to replay a packet stream given the Wireshark session and see if we can reproduce with that?
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to Boris Zbarsky (:bz) from comment #5) > > - it is definitely not an iframe issue, it also occurs when the stream is accessed > > directly, > > Right. The same code runs for those cases. > > I would assume the exact packet boundaries in the original stream are > relevant... Patrick, do we have something that would be able to replay a > packet stream given the Wireshark session and see if we can reproduce with > that? I've never seen anything that effectively replays at the packet level because of the stateful nature of it. You can replay captures for doing tests on routers and such, but the sequence numbers get all messed up if trying to be a server. I think looking at the multipart headers of the uploaded capture more closely either in wireshark or after processing with tcpflow might be useful. It could be that empty 0.9 thing we fixed a little while back. That wasn't on 7. Luc, can you confirm it reproduces on nightly?
Yes it still occurs on 10.0a1 (2011-11-08). I'll upload the capture file. Thanks.
Whiteboard: [necko-backlog]
Priority: -- → P1
Priority: P1 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: