зеркало из https://github.com/mozilla/pjs.git
Changed printf(...) to puts(...) in OnDataAvailable(...) calls. This allows % characters to be present in the output stream without crashing the test app... Added call to AsyncRead(... )in Testprotocols.cpp to get http working again...
This commit is contained in:
Родитель
5007f91883
Коммит
ef79bb73c3
|
@ -133,7 +133,7 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
|||
do {
|
||||
nsresult rv = aIStream->Read(buf, 1024, &amt);
|
||||
buf[amt] = '\0';
|
||||
printf(buf);
|
||||
puts(buf);
|
||||
} while (amt != 0);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -298,6 +298,11 @@ main(int argc, char* argv[])
|
|||
|
||||
// But calling the open is required!
|
||||
// pConnection->Open();
|
||||
pConnection->AsyncRead(0, // staring position
|
||||
-1, // number of bytes to read
|
||||
nsnull, // ISupports context
|
||||
gEventQ, // nsIEventQ for marshalling
|
||||
nsnull); // IStreamListener consumer
|
||||
}
|
||||
} else {
|
||||
printf("NewChannelFromURI failed!\n");
|
||||
|
|
|
@ -109,7 +109,7 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
|||
do {
|
||||
nsresult rv = aIStream->Read(buf, 1024, &amt);
|
||||
buf[amt] = '\0';
|
||||
printf(buf);
|
||||
puts(buf);
|
||||
} while (amt != 0);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -190,7 +190,7 @@ InputConsumer::OnDataAvailable(nsISupports* context,
|
|||
nsresult rv = aIStream->Read(buf, 1024, &amt);
|
||||
mBytesRead += amt;
|
||||
buf[amt] = '\0';
|
||||
printf(buf);
|
||||
puts(buf);
|
||||
} while (amt != 0);
|
||||
|
||||
if (mConnection->GetBufferLength() == mBytesRead) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче