|
|
@ -183,7 +183,7 @@ mng_retcode read_databuffer (mng_datap pData,
|
|
|
|
{ /* not enough space left in buffer ? */
|
|
|
|
{ /* not enough space left in buffer ? */
|
|
|
|
if (pData->iSuspendbufsize - pData->iSuspendbufleft -
|
|
|
|
if (pData->iSuspendbufsize - pData->iSuspendbufleft -
|
|
|
|
(mng_uint32)(pData->pSuspendbufnext - pData->pSuspendbuf) <
|
|
|
|
(mng_uint32)(pData->pSuspendbufnext - pData->pSuspendbuf) <
|
|
|
|
MNG_SUSPENDRETQUESTSIZE)
|
|
|
|
MNG_SUSPENDREQUESTSIZE)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pData->iSuspendbufleft) /* then lets shift (if there's anything left) */
|
|
|
|
if (pData->iSuspendbufleft) /* then lets shift (if there's anything left) */
|
|
|
|
MNG_COPY (pData->pSuspendbuf, pData->pSuspendbufnext, pData->iSuspendbufleft)
|
|
|
|
MNG_COPY (pData->pSuspendbuf, pData->pSuspendbufnext, pData->iSuspendbufleft)
|
|
|
@ -191,12 +191,12 @@ mng_retcode read_databuffer (mng_datap pData,
|
|
|
|
pData->pSuspendbufnext = pData->pSuspendbuf;
|
|
|
|
pData->pSuspendbufnext = pData->pSuspendbuf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* still not enough room ? */
|
|
|
|
/* still not enough room ? */
|
|
|
|
if (pData->iSuspendbufsize - pData->iSuspendbufleft < MNG_SUSPENDRETQUESTSIZE)
|
|
|
|
if (pData->iSuspendbufsize - pData->iSuspendbufleft < MNG_SUSPENDREQUESTSIZE)
|
|
|
|
MNG_ERROR (pData, MNG_INTERNALERROR)
|
|
|
|
MNG_ERROR (pData, MNG_INTERNALERROR)
|
|
|
|
/* now read some more data */
|
|
|
|
/* now read some more data */
|
|
|
|
pTemp = pData->pSuspendbufnext + pData->iSuspendbufleft;
|
|
|
|
pTemp = pData->pSuspendbufnext + pData->iSuspendbufleft;
|
|
|
|
|
|
|
|
|
|
|
|
if (!pData->fReaddata (((mng_handle)pData), pTemp, MNG_SUSPENDRETQUESTSIZE, &iTemp))
|
|
|
|
if (!pData->fReaddata (((mng_handle)pData), pTemp, MNG_SUSPENDREQUESTSIZE, &iTemp))
|
|
|
|
MNG_ERROR (pData, MNG_APPIOERROR);
|
|
|
|
MNG_ERROR (pData, MNG_APPIOERROR);
|
|
|
|
/* adjust fill-counter */
|
|
|
|
/* adjust fill-counter */
|
|
|
|
pData->iSuspendbufleft += iTemp;
|
|
|
|
pData->iSuspendbufleft += iTemp;
|
|
|
@ -217,7 +217,7 @@ mng_retcode read_databuffer (mng_datap pData,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{ /* suspension required ? */
|
|
|
|
{ /* suspension required ? */
|
|
|
|
if ((iSize > pData->iSuspendbufleft) && (iTemp < MNG_SUSPENDRETQUESTSIZE))
|
|
|
|
if ((iSize > pData->iSuspendbufleft) && (iTemp < MNG_SUSPENDREQUESTSIZE))
|
|
|
|
pData->bSuspended = MNG_TRUE;
|
|
|
|
pData->bSuspended = MNG_TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|