httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Fister" <jasonfis...@gmail.com>
Subject 'Expect' HTTP Header
Date Wed, 17 Sep 2008 18:49:20 GMT
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