Upload Channel API changes. Bug 29839. r=darin@Netscape.com, sr=rpotts@netscape.com.

Also fixes bug 63408, not alerting when file-not-found. r/sr same as above
This commit is contained in:
dougt@netscape.com
2001-09-05 03:52:26 +00:00
parent c32560cbe0
commit 4a1195335f
14 changed files with 136 additions and 53 deletions

View File

@@ -66,6 +66,7 @@
#include "nsEscape.h"
// Interfaces Needed
#include "nsIUploadChannel.h"
#include "nsIHttpChannel.h"
#include "nsIDataChannel.h"
#include "nsIProgressEventSink.h"
@@ -4519,7 +4520,11 @@ nsresult nsDocShell::DoURILoad(nsIURI * aURI,
postDataRandomAccess->Seek(PR_SEEK_SET, 0);
}
httpChannel->SetUploadStream(aPostData);
nsCOMPtr<nsIUploadChannel> uploadChannel(do_QueryInterface(httpChannel));
NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");
// we really need to have a content type associated with this stream!!
uploadChannel->SetUploadStream(aPostData,nsnull, -1);
/* If there is a valid postdata *and* it is a History Load,
* set up the cache key on the channel, to retrieve the
* data only from the cache. When there is a postdata
@@ -4993,6 +4998,7 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIChannel * aChannel,
// Get the post data from the channel
nsCOMPtr<nsIInputStream> inputStream;
if (aChannel) {
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(aChannel));
if (httpChannel) {