2000-03-23 04:09:39 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): ruslan
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsHTTPCompressConv.h"
|
|
|
|
#include "nsIAllocator.h"
|
|
|
|
#include "plstr.h"
|
|
|
|
#include "prlog.h"
|
|
|
|
#include "nsIChannel.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIByteArrayInputStream.h"
|
|
|
|
#include "nsIStringStream.h"
|
|
|
|
|
|
|
|
// nsISupports implementation
|
2000-03-29 07:19:14 +04:00
|
|
|
NS_IMPL_THREADSAFE_ISUPPORTS2 (nsHTTPCompressConv, nsIStreamConverter, nsIStreamListener);
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
// nsFTPDirListingConv methods
|
|
|
|
nsHTTPCompressConv::nsHTTPCompressConv ()
|
|
|
|
: mListener (nsnull),
|
2000-03-24 01:23:14 +03:00
|
|
|
mMode (HTTP_COMPRESS_IDENTITY),
|
2000-03-30 07:21:26 +04:00
|
|
|
mOutBuffer (NULL), mInpBuffer (NULL),
|
|
|
|
mOutBufferLen (0), mInpBufferLen (0),
|
2000-03-24 01:23:14 +03:00
|
|
|
mCheckHeaderDone (PR_FALSE),
|
2000-03-30 07:21:26 +04:00
|
|
|
mGzipStreamEnded (PR_FALSE), mGzipStreamInitialized (PR_FALSE),
|
|
|
|
mLen (0), hMode (0), mSkipCount (0), mFlags (0)
|
2000-03-23 04:09:39 +03:00
|
|
|
{
|
|
|
|
NS_INIT_ISUPPORTS ();
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHTTPCompressConv::~nsHTTPCompressConv ()
|
|
|
|
{
|
|
|
|
NS_IF_RELEASE(mListener);
|
|
|
|
|
|
|
|
if (mInpBuffer != NULL)
|
|
|
|
nsAllocator::Free (mInpBuffer);
|
|
|
|
|
|
|
|
if (mOutBuffer != NULL)
|
|
|
|
nsAllocator::Free (mOutBuffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTTPCompressConv::AsyncConvertData (
|
|
|
|
const PRUnichar *aFromType,
|
|
|
|
const PRUnichar *aToType,
|
|
|
|
nsIStreamListener *aListener,
|
|
|
|
nsISupports *aCtxt)
|
|
|
|
{
|
2000-03-31 14:19:31 +04:00
|
|
|
nsString from (aFromType);
|
|
|
|
nsString to ( aToType );
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
char * fromStr = from.ToNewCString ();
|
|
|
|
char * toStr = to.ToNewCString ();
|
|
|
|
|
|
|
|
if (!PL_strncasecmp (fromStr, HTTP_COMPRESS_TYPE , strlen (HTTP_COMPRESS_TYPE ))
|
|
|
|
||
|
|
|
|
!PL_strncasecmp (fromStr, HTTP_X_COMPRESS_TYPE, strlen (HTTP_X_COMPRESS_TYPE)))
|
|
|
|
mMode = HTTP_COMPRESS_COMPRESS;
|
|
|
|
else
|
|
|
|
if (!PL_strncasecmp (fromStr, HTTP_GZIP_TYPE , strlen (HTTP_COMPRESS_TYPE))
|
|
|
|
||
|
|
|
|
!PL_strncasecmp (fromStr, HTTP_X_GZIP_TYPE , strlen (HTTP_X_GZIP_TYPE)))
|
|
|
|
mMode = HTTP_COMPRESS_GZIP;
|
|
|
|
else
|
|
|
|
if (!PL_strncasecmp (fromStr, HTTP_DEFLATE_TYPE, strlen (HTTP_DEFLATE_TYPE)))
|
|
|
|
mMode = HTTP_COMPRESS_DEFLATE;
|
|
|
|
|
|
|
|
nsAllocator::Free (fromStr);
|
|
|
|
nsAllocator::Free ( toStr);
|
|
|
|
|
|
|
|
// hook ourself up with the receiving listener.
|
|
|
|
mListener = aListener;
|
|
|
|
NS_ADDREF (mListener);
|
|
|
|
|
|
|
|
mAsyncConvContext = aCtxt;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTTPCompressConv::OnStartRequest (nsIChannel *aChannel, nsISupports *aContext)
|
|
|
|
{
|
|
|
|
return mListener -> OnStartRequest (aChannel, aContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTTPCompressConv::OnStopRequest (nsIChannel *aChannel, nsISupports *aContext, nsresult status, const PRUnichar *errorMsg)
|
|
|
|
{
|
|
|
|
return mListener -> OnStopRequest (aChannel, aContext, status, errorMsg);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTTPCompressConv::OnDataAvailable (
|
|
|
|
nsIChannel *aChannel,
|
|
|
|
nsISupports *aContext,
|
|
|
|
nsIInputStream *iStr,
|
|
|
|
PRUint32 aSourceOffset,
|
|
|
|
PRUint32 aCount)
|
|
|
|
{
|
|
|
|
nsresult rv = NS_ERROR_FAILURE;
|
|
|
|
PRUint32 streamLen;
|
|
|
|
|
|
|
|
rv = iStr -> Available (&streamLen);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
|
2000-03-24 01:23:14 +03:00
|
|
|
if (streamLen == 0 || mGzipStreamEnded)
|
2000-03-23 04:09:39 +03:00
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
switch (mMode)
|
|
|
|
{
|
|
|
|
case HTTP_COMPRESS_GZIP :
|
2000-03-24 01:23:14 +03:00
|
|
|
streamLen = check_header (iStr, streamLen, &rv);
|
|
|
|
|
|
|
|
if (rv != NS_OK)
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
if (streamLen == 0)
|
|
|
|
return NS_OK;
|
|
|
|
|
2000-03-23 04:09:39 +03:00
|
|
|
case HTTP_COMPRESS_COMPRESS:
|
2000-03-24 01:23:14 +03:00
|
|
|
case HTTP_COMPRESS_DEFLATE :
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
if (mInpBuffer != NULL && streamLen > mInpBufferLen)
|
|
|
|
{
|
|
|
|
mInpBuffer = (unsigned char *) nsAllocator::Realloc (mInpBuffer, mInpBufferLen = streamLen);
|
2000-03-24 01:23:14 +03:00
|
|
|
|
2000-03-23 04:09:39 +03:00
|
|
|
if (mOutBufferLen < streamLen * 2)
|
2000-04-05 05:43:57 +04:00
|
|
|
mOutBuffer = (unsigned char *) nsAllocator::Realloc (mOutBuffer, mOutBufferLen = streamLen * 3);
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
if (mInpBuffer == NULL || mOutBuffer == NULL)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mInpBuffer == NULL)
|
|
|
|
mInpBuffer = (unsigned char *) nsAllocator::Alloc (mInpBufferLen = streamLen);
|
|
|
|
|
|
|
|
if (mOutBuffer == NULL)
|
|
|
|
mOutBuffer = (unsigned char *) nsAllocator::Alloc (mOutBufferLen = streamLen * 3);
|
|
|
|
|
|
|
|
if (mInpBuffer == NULL || mOutBuffer == NULL)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
iStr -> Read ((char *)mInpBuffer, streamLen, &rv);
|
|
|
|
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
if (mMode == HTTP_COMPRESS_COMPRESS)
|
|
|
|
{
|
|
|
|
unsigned long uLen = mOutBufferLen;
|
|
|
|
int code = uncompress (mOutBuffer, &uLen, mInpBuffer, mInpBufferLen);
|
|
|
|
if (code == Z_BUF_ERROR)
|
|
|
|
{
|
|
|
|
mOutBuffer = (unsigned char *) nsAllocator::Realloc (mOutBuffer, mOutBufferLen *= 3);
|
|
|
|
if (mOutBuffer == NULL)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
code = uncompress (mOutBuffer, &uLen, mInpBuffer, mInpBufferLen);
|
|
|
|
}
|
|
|
|
if (code != Z_OK)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
rv = do_OnDataAvailable (aChannel, aContext, aSourceOffset, (char *)mOutBuffer, (PRUint32) uLen);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
2000-03-24 01:23:14 +03:00
|
|
|
{
|
|
|
|
if (!mGzipStreamInitialized)
|
|
|
|
{
|
|
|
|
memset (&d_stream, 0, sizeof (d_stream));
|
|
|
|
|
2000-03-24 06:18:30 +03:00
|
|
|
if (inflateInit2 (&d_stream, -MAX_WBITS) != Z_OK)
|
2000-03-24 01:23:14 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
2000-03-23 04:09:39 +03:00
|
|
|
|
2000-03-24 01:23:14 +03:00
|
|
|
mGzipStreamInitialized = PR_TRUE;
|
|
|
|
}
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
d_stream.next_in = mInpBuffer;
|
2000-03-24 01:23:14 +03:00
|
|
|
d_stream.avail_in = (uInt)streamLen;
|
2000-03-23 04:09:39 +03:00
|
|
|
|
|
|
|
for ( ; ; )
|
|
|
|
{
|
|
|
|
d_stream.next_out = mOutBuffer;
|
2000-03-24 01:23:14 +03:00
|
|
|
d_stream.avail_out = (uInt)mOutBufferLen;
|
|
|
|
|
2000-03-23 04:09:39 +03:00
|
|
|
int code = inflate (&d_stream, Z_NO_FLUSH);
|
2000-03-24 01:23:14 +03:00
|
|
|
unsigned bytesWritten = (uInt)mOutBufferLen - d_stream.avail_out;
|
|
|
|
|
2000-03-23 04:09:39 +03:00
|
|
|
if (code == Z_STREAM_END)
|
|
|
|
{
|
2000-03-24 01:23:14 +03:00
|
|
|
if (bytesWritten)
|
|
|
|
{
|
|
|
|
rv = do_OnDataAvailable (aChannel, aContext, aSourceOffset, (char *)mOutBuffer, bytesWritten);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
inflateEnd (&d_stream);
|
|
|
|
mGzipStreamEnded = PR_TRUE;
|
2000-03-23 04:09:39 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (code == Z_OK)
|
|
|
|
{
|
2000-03-24 01:23:14 +03:00
|
|
|
if (bytesWritten)
|
|
|
|
{
|
|
|
|
rv = do_OnDataAvailable (aChannel, aContext, aSourceOffset, (char *)mOutBuffer, bytesWritten);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (code == Z_BUF_ERROR)
|
|
|
|
{
|
|
|
|
if (bytesWritten)
|
|
|
|
{
|
|
|
|
rv = do_OnDataAvailable (aChannel, aContext, aSourceOffset, (char *)mOutBuffer, bytesWritten);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
break;
|
2000-03-23 04:09:39 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
} /* for */
|
|
|
|
} /* gzip */
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
rv = mListener -> OnDataAvailable (aChannel, aContext, iStr, aSourceOffset, aCount);
|
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
} /* switch */
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
} /* OnDataAvailable */
|
|
|
|
|
|
|
|
|
|
|
|
// XXX/ruslan: need to implement this too
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTTPCompressConv::Convert (
|
|
|
|
nsIInputStream *aFromStream,
|
|
|
|
const PRUnichar *aFromType,
|
|
|
|
const PRUnichar *aToType,
|
|
|
|
nsISupports *aCtxt,
|
|
|
|
nsIInputStream **_retval)
|
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTTPCompressConv (nsHTTPCompressConv ** aHTTPCompressConv)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aHTTPCompressConv != nsnull, "null ptr");
|
|
|
|
|
|
|
|
if (! aHTTPCompressConv)
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
|
|
|
|
*aHTTPCompressConv = new nsHTTPCompressConv ();
|
|
|
|
|
|
|
|
if (! *aHTTPCompressConv)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
NS_ADDREF(*aHTTPCompressConv);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsHTTPCompressConv::do_OnDataAvailable (nsIChannel *aChannel, nsISupports *aContext, PRUint32 aSourceOffset, char *buffer, PRUint32 aCount)
|
|
|
|
{
|
2000-04-04 18:58:12 +04:00
|
|
|
nsresult rv;
|
2000-03-23 04:09:39 +03:00
|
|
|
|
2000-04-04 18:58:12 +04:00
|
|
|
nsCOMPtr<nsIByteArrayInputStream> convertedStreamSup;
|
2000-03-23 04:09:39 +03:00
|
|
|
|
2000-04-05 02:09:47 +04:00
|
|
|
char * lBuf = (char *) nsAllocator::Alloc (aCount);
|
|
|
|
if (lBuf == NULL)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
memcpy (lBuf, buffer, aCount);
|
|
|
|
|
|
|
|
rv = NS_NewByteArrayInputStream (getter_AddRefs(convertedStreamSup), lBuf, aCount);
|
|
|
|
if (NS_FAILED (rv))
|
2000-03-23 04:09:39 +03:00
|
|
|
return rv;
|
|
|
|
|
2000-04-04 18:58:12 +04:00
|
|
|
nsCOMPtr<nsIInputStream> convertedStream = do_QueryInterface (convertedStreamSup, &rv);
|
2000-03-23 04:09:39 +03:00
|
|
|
if (NS_FAILED (rv))
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
rv = mListener -> OnDataAvailable (aChannel, aContext, convertedStream, aSourceOffset, aCount);
|
|
|
|
|
2000-04-04 18:58:12 +04:00
|
|
|
return rv;
|
2000-03-23 04:09:39 +03:00
|
|
|
}
|
2000-03-24 01:23:14 +03:00
|
|
|
|
|
|
|
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
|
|
|
|
#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
|
|
|
|
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
|
|
|
|
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
|
|
|
|
#define COMMENT 0x10 /* bit 4 set: file comment present */
|
|
|
|
#define RESERVED 0xE0 /* bits 5..7: reserved */
|
|
|
|
|
|
|
|
static unsigned gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
|
|
|
|
|
|
|
|
PRUint32
|
|
|
|
nsHTTPCompressConv::check_header (nsIInputStream *iStr, PRUint32 streamLen, nsresult *rs)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
enum { GZIP_INIT = 0, GZIP_OS, GZIP_EXTRA0, GZIP_EXTRA1, GZIP_EXTRA2, GZIP_ORIG, GZIP_COMMENT, GZIP_CRC };
|
|
|
|
char c;
|
|
|
|
|
|
|
|
*rs = NS_OK;
|
|
|
|
|
|
|
|
if (mCheckHeaderDone)
|
|
|
|
return streamLen;
|
|
|
|
|
|
|
|
while (streamLen)
|
|
|
|
{
|
|
|
|
switch (hMode)
|
|
|
|
{
|
|
|
|
case GZIP_INIT:
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
|
|
|
|
if (mSkipCount == 0 && ((unsigned)c & 0377) != gz_magic[0])
|
|
|
|
{
|
|
|
|
*rs = NS_ERROR_FAILURE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mSkipCount == 1 && ((unsigned)c & 0377) != gz_magic[1])
|
|
|
|
{
|
|
|
|
*rs = NS_ERROR_FAILURE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mSkipCount == 2 && ((unsigned)c & 0377) != Z_DEFLATED)
|
|
|
|
{
|
|
|
|
*rs = NS_ERROR_FAILURE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mSkipCount++;
|
|
|
|
if (mSkipCount == 4)
|
|
|
|
{
|
|
|
|
mFlags = (unsigned) c & 0377;
|
|
|
|
if (mFlags & RESERVED)
|
|
|
|
{
|
|
|
|
*rs = NS_ERROR_FAILURE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
hMode = GZIP_OS;
|
|
|
|
mSkipCount = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_OS :
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
mSkipCount++;
|
|
|
|
|
|
|
|
if (mSkipCount == 6)
|
|
|
|
hMode = GZIP_EXTRA0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_EXTRA0:
|
|
|
|
if (mFlags & EXTRA_FIELD)
|
|
|
|
{
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
mLen = (uInt) c & 0377;
|
|
|
|
hMode = GZIP_EXTRA1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
hMode = GZIP_ORIG;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_EXTRA1:
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
mLen = ((uInt) c & 0377) << 8;
|
|
|
|
mSkipCount = 0;
|
|
|
|
hMode = GZIP_EXTRA2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_EXTRA2:
|
|
|
|
if (mSkipCount == mLen)
|
|
|
|
hMode = GZIP_ORIG;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
mSkipCount++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_ORIG:
|
|
|
|
if (mFlags & ORIG_NAME)
|
|
|
|
{
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
if (c == 0)
|
|
|
|
hMode = GZIP_COMMENT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
hMode = GZIP_COMMENT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_COMMENT:
|
|
|
|
if (mFlags & GZIP_COMMENT)
|
|
|
|
{
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
if (c == 0)
|
|
|
|
{
|
|
|
|
hMode = GZIP_CRC;
|
|
|
|
mSkipCount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hMode = GZIP_CRC;
|
|
|
|
mSkipCount = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GZIP_CRC:
|
|
|
|
if (mFlags & HEAD_CRC)
|
|
|
|
{
|
|
|
|
iStr -> Read (&c, 1, &rv);
|
|
|
|
streamLen--;
|
|
|
|
mSkipCount++;
|
|
|
|
if (mSkipCount == 2)
|
|
|
|
{
|
|
|
|
mCheckHeaderDone = PR_TRUE;
|
|
|
|
return streamLen;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mCheckHeaderDone = PR_TRUE;
|
|
|
|
return streamLen;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return streamLen;
|
|
|
|
}
|