History | View | Annotate | Download (41.1 kB)
ganeti.http: Don't reuse key and cert objects
Reusing the private key and certificate objects gave us problems. Thispatch changes the code to only cache the PEM data, but the objectsthemselves. For every socket, the private key and certificate objectsare created again....
ganeti.http: Add another class to contain SSL key and certificate
Otherwise we would read them for every request the HTTP clientmakes against a server and this is not needed.
Reviewed-by: iustinp
Make HttpClientManager threadsafe
This allows a single HttpClientManager to be used from more than onethread at the same time. We discussed having one HttpClientManagerper job queue thread. Assuming there should be one HTTP thread pernode, this would mean quadratic growth with the number of nodes. By...
HTTP server: Do not decode empty entity body
Reviewed-by: imsnah
ganeti.http: Implement SSL for HTTP client
Implementing SSL for the HTTP client required more work than I expected.For correct error handling, quite a lot of code is needed. To avoidcode duplication, I moved a lot of the socket handling code into asingle function named _SocketOperation. It takes care of the polling...
ganeti.http: Move SSL socket creation into base class
The same code will be used by the HTTP client.
ganeti.http: Add constant for "Unexpected EOF"
This is an expected error message and will be used in two places.
Add new HTTP client class
It is based on the WorkerPool class which is already used for the jobqueue and master daemon. Each request must be encapsulated in aninstance of HttpClientRequest, which will then be passed toHttpClientManager for processing. Upon completion, the request object...
ganeti.http: Use 411 Length Required in server code
ganeti.http: Add more constants
As a preparation for the new HTTP client class, add more constantsto ganeti.http.
ganeti.http: Implement SSL certificates
Reviewed-by: killerfoxi
Document HttpServer.__init__
At the same time, simplify the interface a bit by not using a tuple.
Reviewed-by: killerfoxi, ultrotter
http library: Always fork before reading request
It turned out that clients not sending a full request will stopus from responding to further requests. This patch leverages thesituation a bit by always forking before handling the request,but we still have DoS situations....
Convert http.py to use the logging module
Remove old HTTP server code
All users of this code have been migrated to the new and shiny HttpServerclass.
It also fixes a typo in the ApacheLogfile unittests. It has not yet beendecided whether we should keep ApacheLogfile or not, hence leaving it in....
ETag passing support.
Add new HTTP server implementation
This patch adds another implementation of an HTTP server. It'sbased on code of Python's BaseHTTPServer, from both version2.4 and 3k. In the future we can write code to decide whetherwe should fork for a request or not. Keep-alive is not supported....
Fix pylint-detected issues
This is mostly: - whitespace fix (space at EOL in some files, not all, broken indentation, etc) - variable names overriding others (one is a real bug in there) - too-long-lines - cleanup of most unused imports (not all)...
Switch RAPI to ganeti.http module
Add generic HTTP server classes
Some of the code is adopted from the 1.2 branch(lib/rapi/RESTHTTPServer.py). This code can be used as a base for thevarious HTTP servers in Ganeti.