various fixes. Big one was that we're no longer passing the uri in as the context to nsAsyncStreamObserver, it's now the channel.

This commit is contained in:
valeski%netscape.com 1999-06-29 21:53:45 +00:00
Родитель 9381d90062
Коммит 4eaa64d3c1
2 изменённых файлов: 8 добавлений и 1 удалений

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

@ -107,6 +107,8 @@ static nsresult
GetScheme(const char* inURI, char* *scheme)
{
// search for something up to a colon, and call it the scheme
NS_ASSERTION(inURI, "null pointer");
if (!inURI) return NS_ERROR_NULL_POINTER;
char c;
const char* URI = inURI;
PRUint32 i = 0;

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

@ -41,7 +41,11 @@ NS_NewURI(nsIURI* *result, const nsString& spec, nsIURI* baseURI)
// XXX we need a strategy to deal w/ unicode specs (if there should
// XXX even be such a thing)
const char* specStr = spec.GetBuffer();
if (!specStr)
specStr = spec.ToNewCString(); // this forces a single byte char*
nsresult rv = NS_NewURI(result, specStr, baseURI);
if (specStr)
nsCRT::free((char*)specStr);
return rv;
}
@ -86,7 +90,8 @@ NS_OpenURI(nsIStreamListener* aConsumer, nsIURI* uri,
rv = serv->NewChannelFromURI("load", uri, nsnull, &channel);
if (NS_FAILED(rv)) return rv;
rv = channel->AsyncRead(0, -1, uri, // uri used as context
rv = channel->AsyncRead(0, -1,
channel, // channel as the context (the nsDocLoader expects this)
aConsumer);
if (NS_FAILED(rv)) goto done;