diff --git a/netwerk/base/public/nsITransport.idl b/netwerk/base/public/nsITransport.idl index bc4e41219904..2acbea2e33a0 100644 --- a/netwerk/base/public/nsITransport.idl +++ b/netwerk/base/public/nsITransport.idl @@ -48,7 +48,7 @@ interface nsITransport : nsISupports * Open an input stream on this transport. * * @param offset - read starting at this offset - * @param count - read this many bytes (pass ULONG_MAX if unlimited) + * @param count - read this many bytes (pass PRUint32(-1) if unlimited) * @param flags - optional transport specific flags */ nsIInputStream openInputStream(in unsigned long offset, @@ -59,7 +59,7 @@ interface nsITransport : nsISupports * Open an output stream on this transport. * * @param offset - write starting at this offset - * @param count - write no more than this many bytes (pass ULONG_MAX if unlimited) + * @param count - write no more than this many bytes (pass PRUint32(-1) if unlimited) * @param flags - optional transport specific flags */ nsIOutputStream openOutputStream(in unsigned long offset, @@ -72,7 +72,7 @@ interface nsITransport : nsISupports * @param listener - notify this listener when data is available * @param ctxt - opaque parameter passed to listener methods * @param offset - read starting at this offset - * @param count - read this many bytes (pass ULONG_MAX if unlimited) + * @param count - read this many bytes (pass PRUint32(-1) if unlimited) * @param flags - optional transport specific flags */ nsIRequest asyncRead(in nsIStreamListener listener, @@ -87,7 +87,7 @@ interface nsITransport : nsISupports * @param provider - notify this provider when data can be written * @param ctxt - opaque parameter passed to provider methods * @param offset - write starting at this offset - * @param count - write no more than this many bytes (pass ULONG_MAX if unlimited) + * @param count - write no more than this many bytes (pass PRUint32(-1) if unlimited) * @param flags - optional transport specific flags */ nsIRequest asyncWrite(in nsIStreamProvider provider, diff --git a/netwerk/base/src/nsFileTransport.cpp b/netwerk/base/src/nsFileTransport.cpp index 126b9579f627..7d8ba5cc6450 100644 --- a/netwerk/base/src/nsFileTransport.cpp +++ b/netwerk/base/src/nsFileTransport.cpp @@ -414,7 +414,7 @@ nsFileTransport::OpenInputStream(PRUint32 aTransferOffset, nsIInputStream **aResult) { NS_ENSURE_ARG_POINTER(aResult); - NS_ASSERTION(aTransferCount == ULONG_MAX, "need to wrap input stream in one that truncates"); + NS_ASSERTION(aTransferCount == PRUint32(-1), "need to wrap input stream in one that truncates"); nsresult rv = mStreamIO->GetInputStream(aResult); if (NS_SUCCEEDED(rv) && aTransferOffset) { @@ -434,7 +434,7 @@ nsFileTransport::OpenOutputStream(PRUint32 aTransferOffset, nsIOutputStream **aResult) { NS_ENSURE_ARG_POINTER(aResult); - NS_ASSERTION(aTransferCount == ULONG_MAX, "need to wrap output stream in one that truncates"); + NS_ASSERTION(aTransferCount == PRUint32(-1), "need to wrap output stream in one that truncates"); nsresult rv = mStreamIO->GetOutputStream(aResult); if (NS_SUCCEEDED(rv) && aTransferOffset) { diff --git a/netwerk/protocol/about/src/nsAboutCacheEntry.cpp b/netwerk/protocol/about/src/nsAboutCacheEntry.cpp index 55ae75f5c952..aacf7ca06e88 100644 --- a/netwerk/protocol/about/src/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/src/nsAboutCacheEntry.cpp @@ -75,7 +75,7 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor, nsresult rv; // Init: (block size, maximum length) - rv = NS_NewStorageStream(256, ULONG_MAX, getter_AddRefs(storageStream)); + rv = NS_NewStorageStream(256, PRUint32(-1), getter_AddRefs(storageStream)); if (NS_FAILED(rv)) return rv; rv = storageStream->GetOutputStream(0, getter_AddRefs(outputStream)); diff --git a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index fc784fbd24a4..0f47f1d73b96 100644 --- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -156,7 +156,7 @@ DataRequestForwarder::DelayedOnStartRequest(nsIRequest *request, nsISupports *ct NS_ASSERTION(0, "Could not create cache transport."); return rv; } - rv = transport->OpenOutputStream(0, (PRUint32) ULONG_MAX, 0, getter_AddRefs(mCacheOutputStream)); + rv = transport->OpenOutputStream(0, PRUint32(-1), 0, getter_AddRefs(mCacheOutputStream)); if (NS_FAILED(rv)) { NS_ASSERTION(0, "Could not create cache output stream."); @@ -1521,13 +1521,13 @@ nsFtpState::S_list() { NS_ASSERTION(0, "Could not create cache transport."); return rv; } - rv = transport->AsyncRead(forwarder, nsnull, 0, ULONG_MAX, 0, getter_AddRefs(mDPipeRequest)); + rv = transport->AsyncRead(forwarder, nsnull, 0, PRUint32(-1), 0, getter_AddRefs(mDPipeRequest)); return rv; } (void) forwarder->SetCacheEntryDescriptor(mCacheEntry); #endif - rv = mDPipe->AsyncRead(forwarder, nsnull, 0, ULONG_MAX, 0, getter_AddRefs(mDPipeRequest)); + rv = mDPipe->AsyncRead(forwarder, nsnull, 0, PRUint32(-1), 0, getter_AddRefs(mDPipeRequest)); NS_RELEASE(forwarder); // let the transport worry about this objects lifespan return rv; } @@ -1560,7 +1560,7 @@ nsFtpState::S_retr() { PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x) forwarder->Init failed (rv=%x)\n", this, rv)); return rv; } - rv = mDPipe->AsyncRead(forwarder, nsnull, 0, ULONG_MAX, 0, getter_AddRefs(mDPipeRequest)); + rv = mDPipe->AsyncRead(forwarder, nsnull, 0, PRUint32(-1), 0, getter_AddRefs(mDPipeRequest)); NS_RELEASE(forwarder); // let the transport worry about this objects lifespan return rv; @@ -2293,7 +2293,7 @@ nsFtpState::CreateTransport(const char * host, PRInt32 port, PRUint32 bufferSegm } } - return sts->CreateTransport(host, port, nsnull, ULONG_MAX, + return sts->CreateTransport(host, port, nsnull, PRUint32(-1), bufferSegmentSize, bufferMaxSize, o_pTrans); diff --git a/netwerk/protocol/http/src/nsHTTPChannel.cpp b/netwerk/protocol/http/src/nsHTTPChannel.cpp index ccf917e477a3..b3b0dc48dd9e 100644 --- a/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -1302,7 +1302,7 @@ nsHTTPChannel::ReadFromCache() // Pump the cache data downstream LOG(("\n>>>> Reading from Cache <<<<\n")); rv = mCacheTransport->AsyncRead(listener, mResponseContext, - 0, ULONG_MAX, 0, + 0, PRUint32(-1), 0, getter_AddRefs(mCacheReadRequest)); NS_RELEASE(listener); @@ -1429,7 +1429,7 @@ nsHTTPChannel::CacheReceivedResponse(nsIStreamListener *aListener, if (NS_FAILED(rv)) return rv; nsCOMPtr out; - rv = mCacheTransport->OpenOutputStream(0, ULONG_MAX, 0, getter_AddRefs(out)); + rv = mCacheTransport->OpenOutputStream(0, PRUint32(-1), 0, getter_AddRefs(out)); if (NS_FAILED(rv)) return rv; // XXX disk cache does not support overlapped i/o yet @@ -3082,7 +3082,7 @@ nsHTTPChannel::ProcessNotModifiedResponse(nsIStreamListener *aListener) #ifdef MOZ_NEW_CACHE LOG((">>>> Reading from Cache <<<<\n")); rv = mCacheTransport->AsyncRead(cacheListener, mResponseContext, - 0, ULONG_MAX, 0, + 0, PRUint32(-1), 0, getter_AddRefs(mCacheReadRequest)); #else rv = mCacheChannel->AsyncOpen(cacheListener, mResponseContext);