Project

General

Profile

VirtualRequests » History » Revision 2

Revision 1 (icy, 2008-10-11 17:45) → Revision 2/5 (stbuehler, 2008-10-28 18:38)

h1. VirtualRequests 

 !https://redmine.stbuehler.de/attachments/download/11/virtualrequest.png! 

 One request may need several sub requests; fastcgi defines 3 roles for backends which i would use here too (with a little bit different interpretation): 
 * Authorizer: doesn't see the request content; request handling waits until result is available 
   This one is the same as the fastcgi authorizer. 

   Implementation: @authorize actionblock @ 
   * make a virtual request, copy the "request" into it 
   * wait for response headers; if status = 200: drop content and go on 
     else forward content and response headers  

 * Responder: generates the content 
 * Filter: a response filter 

 h2. Basic Structure 

 * Every virtual request "owns" the request headers and has a pointer for the response headers (which are the request headers of the next one) 
 * callbacks set by the master of a request: 

   * handle_request_headers 
   * handle_response_headers 
   * handle_response_body 
   * handle_response_error 
 * callbacks set by the content handler via vrequest_handle_indirect: handler: 

   * handle_request_headers 
   * handle_request_body 
 * use vrequest_handle_direct if you don't need extra handling (like reading the request-body)