Re: code question about object superseded

"Ming Fu" <[email protected]>
Newsgroups gmane.comp.web.polipo.user
Message-ID <[email protected]>
Hi,

I can narrow the problem to the calculation of haveData

haveData =
            (request->object->length >= 0 &&
             request->object->length <= request->from) ||
            (objectHoleSize(request->object, request->from) == 0);

For a new_object from httpServerHandlerHeaders(), if the header doesn't
include Content-Length, the
object->length will be -1. In such case, the haveData will be false. Once
the haveData is false, httpServeObject will not be called and the code will
slip through and add the VALIDATING flags added on.

Any suggestion of a better algo for haveData? especially, I dont understand
the function of request->from field.

Best Regards,
Ming


On Wed, Dec 17, 2008 at 12:04 PM, Ming Fu <[email protected]> wrote:

> Hi,
>
> In client.c line # 1374-1399
>  /* We're handling the wrong object now.  It's simpler to
>            rebuild the whole data structure from scratch rather than
>            trying to compensate. */
>         rc = delayedHttpClientNoticeRequest(request);
>
> It realizes that the object is superseded, At this point, the new object
> has already received the reply header in httpServerHandlerHeaders(). The
> OBJECT_VALIDATING flags should be off on the new object. However, by calling
> delayedHttpClientNoticeRequest() to rebuild the structure, it will
> eventually call httpClientNoticeRequest(), which will add OBJECT_VALIDATING
> to the new object
>
> client.c line #1257
> request->object->flags |= OBJECT_VALIDATING;
>
> The object can only be send to the client until the OBJECT_VALIDATING flag
> is removed.
> client.c line # 1248
>  if(request->object->flags & OBJECT_VALIDATING)
>         return 1;
>
> As the server has already sent the reply headers, no one will call
> httpServerHandlerHeaders() to remove this flag. The only other place that
> removes the validating flags is when ServerFinish() was called after the
> server has sent the whole reply.
>
> If the reply is large or infinite (stream audio/video), the client will
> receive nothing for that request.
>
> If my trace is correct, I need advice as how to re-build the request
> without calling delayedHttpClientNoticeRequest(request)
>
> Best Regards,
> Ming
>
>
------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.