httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Fister" <jasonfis...@gmail.com>
Subject Re: 'Expect' HTTP Header
Date Thu, 18 Sep 2008 19:35:32 GMT
Can anyone point me in the right direction? I have searched on the web
extensively but I did not find anything helpful.

On Wed, Sep 17, 2008 at 2:49 PM, Jason Fister <jasonfister@gmail.com> wrote:

> Hello folks,
> According to HTTP 1.1 spec, if a client sends a Expect: 100-continue header
> with a request, the server can inspect the header and reply with a HTTP
> status 100 Continue if its ready to accept the data. The client after
> receiving the 100 request will send the request body. The server is also
> allowed to send a final http status msg and close the connection after
> inspecting the headers if it doesn't want to accept the request body.
>
> I am trying to implement this in my apache module but am a little confused
> as to how to do this. Here is a section of the code:
>
> static int my_handler(request_rec* req)
> {
>    .....
>    .....
>    .....
>    bool sta = ShouldSrvrRespondWith100(req);
>    if (tru==sta)
>    {
>      req->status = HTTP_CONTINUE;
>      return OK;
>    }
>    else
>    {
>      ProcessRequest(req);
>    }
> }
>
> The function 'ShouldSrvrRespondWith100' is defined as
>
> bool ShouldSrvrRespondWith100(request_rec* req)
> {
>   if((HTTP ver is 1.1) && ('Expect' HTTP header is set))
>   {
>     return true;
>   }
>   else
>   {
>     return false;
>   }
> }
>
>
> Am I doing this correctly? What is don't understand is I want to resume
> execution of the code from where I left off before I sent the 100 http
> status to the client - how do I achieve that?
>
> in the request_rec structure, there is a field called 'expecting_100'
> should I be checking this value in the request to see if this particular
> request is in response to a 100 continue from the server?
>
> Thanks!
> Jason
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message