Univention Bugzilla – Attachment 6752 Details for
Bug 37980
ucs-test: Connection to download server updates.software-univention.de gets stuck / stalls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
TimeoutHTTPServer.py
TimeoutHTTPServer.py (text/plain), 1.04 KB, created by
Sönke Schwardt-Krummrich
on 2015-03-10 10:49:32 CET
(
hide
)
Description:
TimeoutHTTPServer.py
Filename:
MIME Type:
Creator:
Sönke Schwardt-Krummrich
Created:
2015-03-10 10:49:32 CET
Size:
1.04 KB
patch
obsolete
>#!/usr/bin/python ># >import SimpleHTTPServer >import SocketServer >import time > >PORT = 8000 >TIMEOUT=10 >ALREADY_DELAYED = { > '/3.2/': False, > '/4.0/': False, > '/3.2/maintained/3.2-5/amd64/Packages.gz': False, > '/4.0/maintained/4.0-0/amd64/Packages.gz': False, > } > >class TimeoutHTTPServer(SimpleHTTPServer.SimpleHTTPRequestHandler): > def __init__(self, *args, **kwargs): > SimpleHTTPServer.SimpleHTTPRequestHandler.__init__(self, *args, **kwargs) > > def do_HEAD(self, *args, **kwargs): > print 'do_HEAD ', self.path > self.wait() > SimpleHTTPServer.SimpleHTTPRequestHandler.do_HEAD(self, *args, **kwargs) > > def do_GET(self, *args, **kwargs): > print 'do_GET ', self.path > self.wait() > SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self, *args, **kwargs) > > def wait(self): > global ALREADY_DELAYED > if ALREADY_DELAYED.get(self.path) is False: > print 'WAITING %d SECONDS' % (TIMEOUT,) > time.sleep(TIMEOUT) > ALREADY_DELAYED[self.path] = True > >httpd = SocketServer.TCPServer(("", PORT), TimeoutHTTPServer) >print "serving at port", PORT >httpd.serve_forever()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 37980
: 6752