This repository was archived by the owner on Dec 12, 2022. It is now read-only.
mirrored from https://salsa.debian.org/apt-team/apt.git
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mirror-failure.py: example mirror failure cgi
* methods/mirror.cc: prepare for the failure submit
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# File: cgihttpserver-example-1.py | ||
|
||
import CGIHTTPServer | ||
import BaseHTTPServer | ||
|
||
class Handler(CGIHTTPServer.CGIHTTPRequestHandler): | ||
#cgi_directories = ["/cgi"] | ||
def do_POST(self): | ||
print "do_POST" | ||
#print self.command | ||
#print self.path | ||
#print self.headers | ||
print self.client_address | ||
data = self.rfile.read(int(self.headers["content-length"])) | ||
print data | ||
self.wfile.write("200 Ok\n"); | ||
|
||
PORT = 8000 | ||
|
||
httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler) | ||
print "serving at port", PORT | ||
httpd.serve_forever() | ||
|