I can confirm your problem on:
1. development environment paste http server and
2. nginx proxy pass to paste cherrypy server

Try using httplib2: http://code.google.com/p/httplib2/wiki/Examples

it works for me.

- Didip -

On Wed, Nov 18, 2009 at 2:43 PM, Shailesh Kochhar <[email protected]>wrote:

> Jonathan Vanasco wrote:
> > the paste source has a close_connection attribute / param in
> > HTTPRequest
> >
> http://pythonpaste.org/script/paste/script/wsgiserver/__init__.py.html?f=87&l=480#87
> >
> > maybe your app is configured to close the connection after every
> > request ?
> >
> > or maybe httplib does that by default , and you need to request it
> > stay open ?
>
> Thanks for your help. I added a Connection: Keep-Alive header to my
> requests and
> had some success in debugging the problem.
>
>  >>> con = httplib.HTTPConnection('localhost', 80)
>  >>> con.set_debuglevel(1)
>  >>> con.request('GET', '/appinfo/', headers={'Connection':'Keep-Alive'})
> send: 'GET /appinfo/ HTTP/1.1\r\nHost: localhost\r\nAccept-Encoding:
> identity\r\nConnection: Keep-Alive\r\n\r\n'
>  >>> res = con.getresponse()
> reply: 'HTTP/1.1 200 OK\r\n'
> header: Date: Wed, 18 Nov 2009 22:17:21 GMT
> header: Server: PasteWSGIServer/0.5 Python/2.6
> header: content-type: application/json
> header: pragma: no-cache
> header: cache-control: no-cache
> header: Keep-Alive: timeout=15, max=100
> header: Connection: Keep-Alive
> header: Transfer-Encoding: chunked
>  >>> res.read()
> '{"status": {"code": 200, "response": "OK"}, "result": "Running since Wed
> Nov  4
> 19:47:29 2009 UTC"}'
>
> As you can see the response sets the Keep-Alive timeout to 15 seconds and
> max
> reuses to 100. After that time elapses the connection is closed. Is it
> possible
> to increase these defaults by modifying the paste server config?
>
> Thanks in advance,
>   - Shailesh
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=.


Reply via email to