FInally fix 42283; a=gagan,r=gordon

This commit is contained in:
ruslan%netscape.com 2000-07-20 21:25:19 +00:00
Родитель 2c3efade67
Коммит b9c45237c9
3 изменённых файлов: 33 добавлений и 1 удалений

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

@ -112,6 +112,12 @@ interface nsIHTTPChannel : nsIChannel
to allow other non-http specs to be used in proxy cases.
*/
attribute string proxyRequestURI;
/**
* This is a kludge which tells the channel to create a separate thread with the
* even queue for OpenInputStream or not
*/
attribute boolean openInputStreamHasEventQueue;
};

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

@ -102,7 +102,8 @@ nsHTTPChannel::nsHTTPChannel(nsIURI* i_URL, nsHTTPHandler* i_Handler):
mPipeliningAllowed (PR_TRUE),
mPipelinedRequest (nsnull),
mApplyConversion(PR_TRUE),
mNotificationProxiesBuilt (PR_FALSE)
mNotificationProxiesBuilt (PR_FALSE),
mOpenInputStreamHasEventQueue (PR_TRUE)
{
NS_INIT_REFCNT();
NS_NewISupportsArray ( getter_AddRefs (mStreamAsFileObserverArray ) );
@ -237,6 +238,24 @@ nsHTTPChannel::SetURI(nsIURI* o_URL)
return NS_OK;
}
NS_IMETHODIMP
nsHTTPChannel::GetOpenInputStreamHasEventQueue (PRBool * hasEventQueue)
{
if (!hasEventQueue)
return NS_ERROR_NULL_POINTER;
*hasEventQueue = mOpenInputStreamHasEventQueue;
return NS_OK;
}
NS_IMETHODIMP
nsHTTPChannel::SetOpenInputStreamHasEventQueue (PRBool hasEventQueue)
{
mOpenInputStreamHasEventQueue = hasEventQueue;
return NS_OK;
}
NS_IMETHODIMP
nsHTTPChannel::OpenInputStream(nsIInputStream **o_Stream)
{
@ -252,6 +271,12 @@ nsHTTPChannel::OpenInputStream(nsIInputStream **o_Stream)
if (NS_FAILED(rv))
return rv;
if (mOpenInputStreamHasEventQueue)
{
rv = AsyncRead (listener, nsnull);
return rv;
}
nsSyncHelper *helper = new nsSyncHelper ();
if (!helper)
return NS_ERROR_OUT_OF_MEMORY;

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

@ -202,6 +202,7 @@ protected:
nsCOMPtr<nsISupportsArray> mStreamAsFileObserverArray;
PRBool mApplyConversion;
PRBool mNotificationProxiesBuilt;
PRBool mOpenInputStreamHasEventQueue;
};
#include "nsIRunnable.h"