Added input stream consumer in nsIStreamListener->OnDataAvailable(). not part of the build.

This commit is contained in:
depstein%netscape.com 2002-09-19 05:14:28 +00:00
Родитель 869b48e340
Коммит e7549fdd24
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -88,6 +88,7 @@
#include "nsirequest.h" #include "nsirequest.h"
#include "Tests.h" #include "Tests.h"
#include "prmem.h"
CBrowserImpl::CBrowserImpl() CBrowserImpl::CBrowserImpl()
{ {
@ -469,10 +470,22 @@ NS_IMETHODIMP CBrowserImpl::OnDataAvailable(nsIRequest *request,
PRUint32 offset, PRUint32 count) PRUint32 offset, PRUint32 count)
{ {
nsCString stringMsg; nsCString stringMsg;
PRUint32 readLen;
QAOutput("##### inside nsIStreamListener::OnDataAvailable(). #####"); QAOutput("##### inside nsIStreamListener::OnDataAvailable(). #####");
RequestName(request, stringMsg, 1); RequestName(request, stringMsg, 1);
readLen = count;
// from prmem.h: PR_Malloc()
char *buf = (char *)PR_Malloc(count);
if (!input)
QAOutput("We didn't get the nsIInputStream object.", 1);
else {
// consumer of input stream
rv = input->Read(buf, count, &readLen);
RvTestResult(rv, "nsIInputStream->Read() consumer", 1);
}
FormatAndPrintOutput("OnDataAvailable() offset = ", offset, 1); FormatAndPrintOutput("OnDataAvailable() offset = ", offset, 1);
FormatAndPrintOutput("OnDataAvailable() count = ", count, 1); FormatAndPrintOutput("OnDataAvailable() count = ", count, 1);