From 39799a6d16f05f57a10eb3a60b3a9b378cdc111f Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Thu, 9 Sep 1999 22:18:44 +0000 Subject: [PATCH] EOF changes. --- netwerk/protocol/data/src/nsDataChannel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/netwerk/protocol/data/src/nsDataChannel.cpp b/netwerk/protocol/data/src/nsDataChannel.cpp index d4907f19cffb..25cc0fc7c783 100644 --- a/netwerk/protocol/data/src/nsDataChannel.cpp +++ b/netwerk/protocol/data/src/nsDataChannel.cpp @@ -91,10 +91,10 @@ typedef struct _writeData { NS_METHOD nsReadData(void* closure, // the data from - char* toRawSegment, // where to put the data - PRUint32 offset, // where to start - PRUint32 count, // how much data is there - PRUint32 *readCount) { // how much data was read + char* toRawSegment, // where to put the data + PRUint32 offset, // where to start + PRUint32 count, // how much data is there + PRUint32 *readCount) { // how much data was read nsresult rv = NS_OK; writeData *dataToWrite = (writeData*)closure; PRUint32 write = PR_MIN(count, dataToWrite->dataLen - offset); @@ -102,7 +102,7 @@ nsReadData(void* closure, // the data from *readCount = 0; if (offset == dataToWrite->dataLen) - return NS_BASE_STREAM_EOF; + return NS_OK; // *readCount == 0 is EOF nsCRT::memcpy(toRawSegment, dataToWrite->data + offset, write); @@ -305,7 +305,7 @@ nsDataChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, if (NS_FAILED(rv)) return rv; PRUint32 streamLen; - rv = mDataStream->GetLength(&streamLen); + rv = mDataStream->Available(&streamLen); if (NS_FAILED(rv)) return rv; rv = listener->OnDataAvailable(this, ctxt, mDataStream, 0, streamLen);