Commented: (MODPYTHON-153) Add req.discard_request_body().
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Commented: (MODPYTHON-153) Add req.discard_request_body().




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Commented: (MODPYTHON-153) Add req.discard_request_body().  
Graham Dumpleton (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-02-06 11:58 PM

[ http://issues.apache.org/jira/brows...237
2824 ]

Graham Dumpleton commented on MODPYTHON-153:
--------------------------------------------

Here is the prototype and documentation:

/**
* In HTTP/1.1, any method can have a body.  However, most GET handlers
* wouldn't know what to do with a request body if they received one.
* This helper routine tests for and reads any message body in the request,
* simply discarding whatever it receives.  We need to do this because
* failing to read the request body would cause it to be interpreted
* as the next request on a persistent connection.
* @param r The current request
* @return error status if request is malformed, OK otherwise
*/
AP_DECLARE(int) ap_discard_request_body(request_rec *r);

Note that by rights, mod_python.publisher and mod_python.psp should both cal
l this method for GET requests. As pointed out in documentation above, if it
 didn't and GET request contained content then not discarding it can stuff u
p a following request if a
persistent connection is used and multiple requests are pipelined.

> Add req.discard_request_body().
> -------------------------------
>
>          Key: MODPYTHON-153
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-153
>      Project: mod_python
>         Type: New Feature

>   Components: core
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton

>
> In HTTP/1.1 any method may include a request body, whereas in HTTP/1.0 only POST a
nd PUT were allowed to. To avoid any potential problems if a handler were trying to 
emulate in part the default Apache handler for requests, in would be appropriate for
 a
handler to ensure that any request body is discarded. Apache provides a func
tion specifically for this purpose which is called ap_discard_request_body()
. For completeness this function should be available in the request object A
PI as req.discard_request_b
ody().






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:13 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register