Commit Graph

20 Commits

Author SHA1 Message Date
Adrian Buehlmann
0e6715fa28 rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
Augie Fackler
c986a6137a hgweb: add support for 100-continue as recommended by PEP 333. 2010-02-06 04:27:28 -06:00
Konstantin Zemlyak
738dae163d wsgicgi: call close() on iterable to avoid resource leaks
Quoting PEP 333 (WSGI):

"If the iterable returned by the application has a close() method, the server
or gateway must call that method upon completion of the current request,
whether the request was completed normally, or terminated early due to
an error. (This is to support resource release by the application.
This protocol is intended to complement PEP 325's generator support,
and other common iterables with close() methods."
2010-03-22 15:16:27 +01:00
Benoit Boissinot
4371f512b2 fix spaces/identation issues 2010-02-05 18:50:08 +01:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Patrick Mezard
9c67b65ee1 hgweb: improve IIS PATH_INFO fix 0aba3cc1ee81 (issue1580)
Copy PHP IIS detection.
2010-01-03 17:26:39 +01:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Dirkjan Ochtman
574603a8c0 use dict.iteritems() rather than dict.items()
This should be faster and more future-proof. Calls where the result is to be
sorted using util.sort() have been left unchanged. Calls to .items() on
configparser objects have been left as-is, too.
2009-01-12 09:16:03 +01:00
Dirkjan Ochtman
5e58c613ca hgweb: support broken IIS 5 behavior with .cgi in PATH_INFO 2008-11-25 17:54:49 +01:00
Peter Ruibal
30a2036f9e use Exception(args)-style raising consistently (py3k compatibility) 2008-09-08 13:07:00 +02:00
Dirkjan Ochtman
afa3084f5f hgweb: fix WSGI iterators handling in CGI adapter (issue1254) 2008-08-21 10:55:24 +02:00
Dirkjan Ochtman
857b34f4d7 Fix style nit and add some comments to tests. 2007-12-02 10:12:26 +01:00
Dirkjan Ochtman
a20c52b449 Use SCRIPT_NAME and PATH_INFO instead of REQUEST_URI. This is required by WSGI (fixes issue846). 2007-12-01 19:19:08 +01:00
Dirkjan Ochtman
9851dc942e CGI compatibility fix for 77bd163fb48d. 2007-12-01 18:26:27 +01:00
Wesley J. Landaker
feb6c32251 Handle CGI SSL detection via HTTPS environment better.
Some servers send on/off, 0/1, yes/no, and may be upper or lower case.
This fix will handle all of those permutations. It was inspired by the
detection done in in some other wsgi python web applications I looked at.
2007-07-12 13:55:20 -06:00
Alexis S. L. Carvalho
0e52789888 wsgicgi: change stdin to binary mode 2007-06-04 00:24:48 -03:00
Alexis S. L. Carvalho
9d682f1c81 Switch CGI stdout to binary on windows
Problem diagnosed by Andrei Vermel.
2007-02-13 06:50:00 -02:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
Alexis S. L. Carvalho
741f652c36 hgweb: fix unbundle.
After the WSGI changes, even if a push over HTTP succeeds, apache
complains about "Premature end of script headers: hgwebdir.cgi" and
returns a "HTTP Error 500: Internal Server Error", making the local hg
abort.

The change to either of the files touched by this patch is enough to fix
this, but I think changing both is a more robust solution.
2006-07-03 00:33:19 -03:00
Eric Hopper
4498f60ff4 This patch make several WSGI related alterations.
First, it changes the server to be almost a generic WSGI server.

Second, it changes request.py to have wsgiapplication and
_wsgirequest.  wsgiapplication is a class that creates _wsgirequests
when called by a WSGI compliant server.  It needs to know whether
or not it should create hgwebdir or hgweb requests.

Lastly, wsgicgi.py is added, and the CGI scripts are altered to
use it to launch wsgiapplications in a WSGI compliant way.

As a side effect, all the keepalive code has been removed from
request.py.  This code needs to be moved so that it is exclusively
in server.py
2006-06-27 00:09:33 -07:00