Fix for bug 81751. Add define for mime type multipart/x-mixed-replace and multipart/byteranges. Also export nsIFileStreams.idl on Mac. R=varada, SR=mscott, A=asa

This commit is contained in:
ducarroz%netscape.com 2001-06-04 22:59:22 +00:00
Родитель e8af18563c
Коммит 18073f24cc
6 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -50,6 +50,8 @@
#include "nsIStreamConverterService.h"
#include "nsIPref.h"
#include "nsMimeTypes.h"
static NS_DEFINE_CID(kStreamConvServiceCID, NS_STREAMCONVERTERSERVICE_CID);
static NS_DEFINE_IID(kIURLIID, NS_IURL_IID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
@ -268,8 +270,8 @@ ImageConsumer::DoContent(const char * aContentType,
nsAutoString contentType; contentType.AssignWithConversion(aContentType);
if (contentType.EqualsWithConversion("multipart/x-mixed-replace")
|| contentType.EqualsWithConversion("multipart/mixed")) {
if (contentType.EqualsWithConversion(MULTIPART_MIXED_REPLACE)
|| contentType.EqualsWithConversion(MULTIPART_MIXED)) {
// if we're getting multipart data, we have to convert it.
// so wedge the converter inbetween us and the consumer.
mIsMulti= PR_TRUE;

Просмотреть файл

@ -42,6 +42,9 @@
#include "ImageLogging.h"
#include "nsMimeTypes.h"
NS_IMPL_ISUPPORTS1(imgLoader, imgILoader)
imgLoader::imgLoader()
@ -341,14 +344,14 @@ NS_IMETHODIMP ProxyListener::OnStartRequest(nsIRequest *aRequest, nsISupports *c
in the pipeline to handle the content and pass it along to our
original listener.
*/
if (NS_LITERAL_CSTRING("multipart/x-mixed-replace").Equals(contentType)) {
if (NS_LITERAL_CSTRING(MULTIPART_MIXED_REPLACE).Equals(contentType)) {
nsCOMPtr<nsIStreamConverterService> convServ(do_GetService("@mozilla.org/streamConverters;1", &rv));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIStreamListener> toListener(mDestListener);
nsCOMPtr<nsIStreamListener> fromListener;
rv = convServ->AsyncConvertData(NS_LITERAL_STRING("multipart/x-mixed-replace").get(),
rv = convServ->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_MIXED_REPLACE).get(),
NS_LITERAL_STRING("*/*").get(),
toListener,
nsnull,

Просмотреть файл

@ -83,6 +83,7 @@
#include "nsICookieService.h"
#include "nsIDOMPlugin.h"
#include "nsIDOMMimeType.h"
#include "nsMimeTypes.h"
#include "prprf.h"
#if defined(XP_PC) && !defined(XP_OS2)
@ -1158,7 +1159,7 @@ nsPluginStreamInfo::RequestRead(nsByteRange* rangeList)
if (NS_FAILED(rv))
return rv;
rv = serv->AsyncConvertData(NS_LITERAL_STRING("multipart/byteranges").get(),
rv = serv->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_BYTERANGES).get(),
NS_LITERAL_STRING("*/*").get(),
mPluginStreamListenerPeer,
nsnull,

Просмотреть файл

@ -83,6 +83,7 @@
#include "nsICookieService.h"
#include "nsIDOMPlugin.h"
#include "nsIDOMMimeType.h"
#include "nsMimeTypes.h"
#include "prprf.h"
#if defined(XP_PC) && !defined(XP_OS2)
@ -1158,7 +1159,7 @@ nsPluginStreamInfo::RequestRead(nsByteRange* rangeList)
if (NS_FAILED(rv))
return rv;
rv = serv->AsyncConvertData(NS_LITERAL_STRING("multipart/byteranges").get(),
rv = serv->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_BYTERANGES).get(),
NS_LITERAL_STRING("*/*").get(),
mPluginStreamListenerPeer,
nsnull,

Просмотреть файл

@ -18,6 +18,7 @@ nsISocketTransportService.idl
nsIStreamIO.idl
nsIStreamIOChannel.idl
nsIStreamListener.idl
nsIFileStreams.idl
nsITransport.idl
nsIStreamLoader.idl
nsIDownloader.idl

Просмотреть файл

@ -99,6 +99,9 @@
#define MULTIPART_PARALLEL "multipart/parallel"
#define MULTIPART_SIGNED "multipart/signed"
#define MULTIPART_RELATED "multipart/related"
#define MULTIPART_MIXED_REPLACE "multipart/x-mixed-replace"
#define MULTIPART_BYTERANGES "multipart/byteranges"
#define SUN_ATTACHMENT "x-sun-attachment"
#define TEXT_ENRICHED "text/enriched"