|
|
|
date: Tue, 1 Jul 2008 06:52:01 -0700,
group: microsoft.public.inetsdk.programming.urlmonikers
back
Re: text/html MIME filter with separate thread
"Igor Tandetnik" wrote:
> Alexander wrote:
> What parameters are you passing when calling ReportData?
Here is the code being executed after filter thread having its job done:
(code is executed from filter thread!)
data.object->outgoing_prot_sink->ReportData
(BSCF_FIRSTDATANOTIFICATION |
BSCF_LASTDATANOTIFICATION |
BSCF_DATAFULLYAVAILABLE,
data.object->buffer.size(), data.object->buffer.size());
data.object->outgoing_prot_sink->ReportResult(S_OK, S_OK, NULL);
data.object->buffer is buffer with filtered data.
This results in one Read call, with 8196 bytes of data requested(total
amount is ~30000 bytes in my test case).
As far as I understand there must be the serie if reads, until my Read
handler return S_FALSE.
> What are you returning from your implementation of
> IInternetProtocol::Read? Make sure to fill the buffer with no more data
> than the specified buffer size, and return S_OK if you have more data to
> report, and S_FALSE otherwise.
here is my Read implementation:
if(buffer_p < buffer.size()){
int to_read = (buffer.size() - buffer_p) <= cb ? (buffer.size() -
buffer_p) : cb;
copy(buffer.begin() + buffer_p , buffer.begin() + buffer_p + to_read,
(char*)pv);
buffer_p += to_read;
*pcbRead = to_read;
return buffer_p >= buffer.size() ? S_FALSE : S_OK;
} else {
return S_FALSE;
}
date: Wed, 2 Jul 2008 01:54:03 -0700
author: Alexander
Re: text/html MIME filter with separate thread
"Alexander" wrote in message
news:07E03E72-0EDB-4630-9818-9FC392A7C67B@microsoft.com
> data.object->outgoing_prot_sink->ReportData
> (BSCF_FIRSTDATANOTIFICATION |
> BSCF_LASTDATANOTIFICATION |
> BSCF_DATAFULLYAVAILABLE,
> data.object->buffer.size(), data.object->buffer.size());
>
> data.object->outgoing_prot_sink->ReportResult(S_OK, S_OK, NULL);
>
> here is my Read implementation:
>
> if(buffer_p < buffer.size()){
> int to_read = (buffer.size() - buffer_p) <= cb ? (buffer.size() -
> buffer_p) : cb;
> copy(buffer.begin() + buffer_p , buffer.begin() + buffer_p + to_read,
> (char*)pv);
> buffer_p += to_read;
> *pcbRead = to_read;
> return buffer_p >= buffer.size() ? S_FALSE : S_OK;
> } else {
> return S_FALSE;
> }
I don't see anything obviously wrong in your code (assuming buffer_p is
initialized to 0 at some point). If you have a small sample that
reproduces the problem, you can email it to me at itandetnik@mvps.org,
I'll look at it.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Wed, 2 Jul 2008 08:07:38 -0400
author: Igor Tandetnik
|
|