/usr/lib64/python2.6
NameSizeModeActions
bsddb/-0755rm
compiler/-0755rm
config/-0755rm
ctypes/-0755rm
curses/-0755rm
Demo/-0755rm
distutils/-0755rm
Doc/-0755rm
email/-0755rm
encodings/-0755rm
hotshot/-0755rm
idlelib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib-tk/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
plat-linux2/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
test/-0755rm
Tools/-0755rm
wsgiref/-0755rm
xml/-0755rm
abc.py70340644editdlrm
abc.pyc60710644editdlrm
abc.pyo60130644editdlrm
aifc.py331880644editdlrm
aifc.pyc295640644editdlrm
aifc.pyo295640644editdlrm
anydbm.py26200644editdlrm
anydbm.pyc27750644editdlrm
anydbm.pyo27750644editdlrm
ast.py113470644editdlrm
ast.pyc127800644editdlrm
ast.pyo127800644editdlrm
asynchat.py114020644editdlrm
asynchat.pyc87370644editdlrm
asynchat.pyo87370644editdlrm
asyncore.py200610644editdlrm
asyncore.pyc184520644editdlrm
asyncore.pyo184520644editdlrm
atexit.py17050644editdlrm
atexit.pyc22150644editdlrm
atexit.pyo22150644editdlrm
audiodev.py75970644editdlrm
audiodev.pyc85370644editdlrm
audiodev.pyo85370644editdlrm
base64.py113350755editdlrm
base64.pyc110030644editdlrm
base64.pyo110030644editdlrm
BaseHTTPServer.py219740644editdlrm
BaseHTTPServer.pyc215750644editdlrm
BaseHTTPServer.pyo215750644editdlrm
Bastion.py57440644editdlrm
Bastion.pyc66670644editdlrm
Bastion.pyo66670644editdlrm
bdb.py205970644editdlrm
bdb.pyc185670644editdlrm
bdb.pyo185670644editdlrm
binhex.py148780644editdlrm
binhex.pyc158750644editdlrm
binhex.pyo158750644editdlrm
bisect.py26620644editdlrm
bisect.pyc31730644editdlrm
bisect.pyo31730644editdlrm
calendar.py231100644editdlrm
calendar.pyc281650644editdlrm
calendar.pyo281650644editdlrm
cgi.py344780755editdlrm
cgi.pyc328180644editdlrm
cgi.pyo328180644editdlrm
CGIHTTPServer.py127730644editdlrm
CGIHTTPServer.pyc108200644editdlrm
CGIHTTPServer.pyo108200644editdlrm
cgitb.py121550644editdlrm
cgitb.pyc124610644editdlrm
cgitb.pyo124610644editdlrm
chunk.py53720644editdlrm
chunk.pyc56450644editdlrm
chunk.pyo56450644editdlrm
cmd.py149620644editdlrm
cmd.pyc139540644editdlrm
cmd.pyo139540644editdlrm
code.py102170644editdlrm
code.pyc104270644editdlrm
code.pyo104270644editdlrm
codecs.py352660644editdlrm
codecs.pyc367210644editdlrm
codecs.pyo367210644editdlrm
codeop.py59990644editdlrm
codeop.pyc66360644editdlrm
codeop.pyo66360644editdlrm
collections.py137300644editdlrm
collections.pyc144620644editdlrm
collections.pyo144090644editdlrm
colorsys.py34590644editdlrm
colorsys.pyc40410644editdlrm
colorsys.pyo40410644editdlrm
commands.py25430644editdlrm
commands.pyc24890644editdlrm
commands.pyo24890644editdlrm
compileall.py52850644editdlrm
compileall.pyc49970644editdlrm
compileall.pyo49970644editdlrm
ConfigParser.py259890644editdlrm
ConfigParser.pyc238650644editdlrm
ConfigParser.pyo238650644editdlrm
contextlib.py41360644editdlrm
contextlib.pyc41510644editdlrm
contextlib.pyo41510644editdlrm
Cookie.py250540644editdlrm
Cookie.pyc221450644editdlrm
Cookie.pyo221450644editdlrm
cookielib.py647260644editdlrm
cookielib.pyc553700644editdlrm
cookielib.pyo551790644editdlrm
copy.py111770644editdlrm
copy.pyc116750644editdlrm
copy.pyo115790644editdlrm
copy_reg.py68000644editdlrm
copy_reg.pyc51780644editdlrm
copy_reg.pyo51320644editdlrm
cProfile.py63370755editdlrm
cProfile.pyc62390644editdlrm
cProfile.pyo62390644editdlrm
crypt.py22290644editdlrm
crypt.pyc30550644editdlrm
crypt.pyo30550644editdlrm
csv.py157300644editdlrm
csv.pyc132260644editdlrm
csv.pyo132260644editdlrm
dbhash.py5350644editdlrm
dbhash.pyc7600644editdlrm
dbhash.pyo7600644editdlrm
decimal.py1992730644editdlrm
decimal.pyc1556810644editdlrm
decimal.pyo1556150644editdlrm
difflib.py810800644editdlrm
difflib.pyc611930644editdlrm
difflib.pyo611390644editdlrm
dircache.py11260644editdlrm
dircache.pyc15840644editdlrm
dircache.pyo15840644editdlrm
dis.py64490644editdlrm
dis.pyc63660644editdlrm
dis.pyo63660644editdlrm
doctest.py1015160644editdlrm
doctest.pyc809940644editdlrm
doctest.pyo807060644editdlrm
DocXMLRPCServer.py105990644editdlrm
DocXMLRPCServer.pyc99570644editdlrm
DocXMLRPCServer.pyo98490644editdlrm
dumbdbm.py88200644editdlrm
dumbdbm.pyc65850644editdlrm
dumbdbm.pyo65850644editdlrm
dummy_thread.py44180644editdlrm
dummy_thread.pyc54130644editdlrm
dummy_thread.pyo54130644editdlrm
dummy_threading.py28040644editdlrm
dummy_threading.pyc12970644editdlrm
dummy_threading.pyo12970644editdlrm
filecmp.py94700644editdlrm
filecmp.pyc96320644editdlrm
filecmp.pyo96320644editdlrm
fileinput.py141430644editdlrm
fileinput.pyc149280644editdlrm
fileinput.pyo149280644editdlrm
fnmatch.py32390644editdlrm
fnmatch.pyc35790644editdlrm
fnmatch.pyo35790644editdlrm
formatter.py149110644editdlrm
formatter.pyc193030644editdlrm
formatter.pyo193030644editdlrm
fpformat.py46990644editdlrm
fpformat.pyc47350644editdlrm
fpformat.pyo47350644editdlrm
fractions.py200730644editdlrm
fractions.pyc181190644editdlrm
fractions.pyo181190644editdlrm
ftplib.py291970644editdlrm
ftplib.pyc285030644editdlrm
ftplib.pyo285030644editdlrm
functools.py21620644editdlrm
functools.pyc19270644editdlrm
functools.pyo19270644editdlrm
genericpath.py30200644editdlrm
genericpath.pyc32920644editdlrm
genericpath.pyo32920644editdlrm
getopt.py73280644editdlrm
getopt.pyc67300644editdlrm
getopt.pyo66830644editdlrm
getpass.py55340644editdlrm
getpass.pyc47540644editdlrm
getpass.pyo47540644editdlrm
gettext.py199680644editdlrm
gettext.pyc157600644editdlrm
gettext.pyo157600644editdlrm
glob.py22490644editdlrm
glob.pyc24090644editdlrm
glob.pyo24090644editdlrm
gzip.py167540644editdlrm
gzip.pyc143860644editdlrm
gzip.pyo143860644editdlrm
hashlib.py44270644editdlrm
hashlib.pyc39810644editdlrm
hashlib.pyo39810644editdlrm
heapq.py159950644editdlrm
heapq.pyc126940644editdlrm
heapq.pyo126940644editdlrm
hmac.py45310644editdlrm
hmac.pyc45090644editdlrm
hmac.pyo45090644editdlrm
htmlentitydefs.py180540644editdlrm
htmlentitydefs.pyc63710644editdlrm
htmlentitydefs.pyo63710644editdlrm
htmllib.py128690644editdlrm
htmllib.pyc203840644editdlrm
htmllib.pyo203840644editdlrm
HTMLParser.py135760644editdlrm
HTMLParser.pyc122580644editdlrm
HTMLParser.pyo119500644editdlrm
httplib.py487970644editdlrm
httplib.pyc377320644editdlrm
httplib.pyo375360644editdlrm
ihooks.py174520644editdlrm
ihooks.pyc208370644editdlrm
ihooks.pyo207580644editdlrm
imaplib.py477710644editdlrm
imaplib.pyc452250644editdlrm
imaplib.pyo424750644editdlrm
imghdr.py35440644editdlrm
imghdr.pyc49050644editdlrm
imghdr.pyo49050644editdlrm
imputil.py260090644editdlrm
imputil.pyc160370644editdlrm
imputil.pyo158650644editdlrm
inspect.py381890644editdlrm
inspect.pyc371650644editdlrm
inspect.pyo371650644editdlrm
io.py661650644editdlrm
io.pyc630420644editdlrm
io.pyo630420644editdlrm
keyword.py19970755editdlrm
keyword.pyc21170644editdlrm
keyword.pyo21170644editdlrm
linecache.py41280644editdlrm
linecache.pyc32680644editdlrm
linecache.pyo32680644editdlrm
locale.py826740644editdlrm
locale.pyc466760644editdlrm
locale.pyo466760644editdlrm
macpath.py62530644editdlrm
macpath.pyc77070644editdlrm
macpath.pyo77070644editdlrm
macurl2path.py32750644editdlrm
macurl2path.pyc28250644editdlrm
macurl2path.pyo28250644editdlrm
mailbox.py758240644editdlrm
mailbox.pyc760690644editdlrm
mailbox.pyo760200644editdlrm
mailcap.py84020644editdlrm
mailcap.pyc80790644editdlrm
mailcap.pyo80790644editdlrm
markupbase.py143500644editdlrm
markupbase.pyc94640644editdlrm
markupbase.pyo92700644editdlrm
md5.py4100644editdlrm
md5.pyc3780644editdlrm
md5.pyo3780644editdlrm
mhlib.py334340644editdlrm
mhlib.pyc341370644editdlrm
mhlib.pyo341370644editdlrm
mimetools.py71680644editdlrm
mimetools.pyc83200644editdlrm
mimetools.pyo83200644editdlrm
mimetypes.py188220644editdlrm
mimetypes.pyc168720644editdlrm
mimetypes.pyo168720644editdlrm
MimeWriter.py64820644editdlrm
MimeWriter.pyc73830644editdlrm
MimeWriter.pyo73830644editdlrm
mimify.py150240755editdlrm
mimify.pyc122190644editdlrm
mimify.pyo122190644editdlrm
modulefinder.py242830644editdlrm
modulefinder.pyc190070644editdlrm
modulefinder.pyo189190644editdlrm
multifile.py48200644editdlrm
multifile.pyc54790644editdlrm
multifile.pyo54350644editdlrm
mutex.py18660644editdlrm
mutex.pyc25260644editdlrm
mutex.pyo25260644editdlrm
netrc.py41110644editdlrm
netrc.pyc36020644editdlrm
netrc.pyo36020644editdlrm
new.py7060644editdlrm
new.pyc9100644editdlrm
new.pyo9100644editdlrm
nntplib.py214700644editdlrm
nntplib.pyc211790644editdlrm
nntplib.pyo211790644editdlrm
ntpath.py177520644editdlrm
ntpath.pyc116200644editdlrm
ntpath.pyo115730644editdlrm
nturl2path.py22390644editdlrm
nturl2path.pyc17770644editdlrm
nturl2path.pyo17770644editdlrm
numbers.py102710644editdlrm
numbers.pyc139640644editdlrm
numbers.pyo139640644editdlrm
opcode.py52480644editdlrm
opcode.pyc59170644editdlrm
opcode.pyo59170644editdlrm
optparse.py608490644editdlrm
optparse.pyc542390644editdlrm
optparse.pyo541570644editdlrm
ordereddict.py360644editdlrm
ordereddict.pyc1850644editdlrm
ordereddict.pyo1850644editdlrm
os.py258020644editdlrm
os.pyc258080644editdlrm
os.pyo258080644editdlrm
os2emxpath.py46030644editdlrm
os2emxpath.pyc45360644editdlrm
os2emxpath.pyo45360644editdlrm
pdb.doc78990644editdlrm
pdb.py453330755editdlrm
pdb.pyc438130644editdlrm
pdb.pyo438130644editdlrm
pickle.py448110644editdlrm
pickle.pyc386450644editdlrm
pickle.pyo384400644editdlrm
pickletools.py743480644editdlrm
pickletools.pyc571430644editdlrm
pickletools.pyo562460644editdlrm
pipes.py96470644editdlrm
pipes.pyc94600644editdlrm
pipes.pyo94600644editdlrm
pkgutil.py200010644editdlrm
pkgutil.pyc190200644editdlrm
pkgutil.pyo190200644editdlrm
platform.py526300755editdlrm
platform.pyc387970644editdlrm
platform.pyo387970644editdlrm
plistlib.py158060644editdlrm
plistlib.pyc200500644editdlrm
plistlib.pyo199600644editdlrm
popen2.py84160644editdlrm
popen2.pyc90640644editdlrm
popen2.pyo90200644editdlrm
poplib.py128250644editdlrm
poplib.pyc134180644editdlrm
poplib.pyo134180644editdlrm
posixfile.py80030644editdlrm
posixfile.pyc77240644editdlrm
posixfile.pyo77240644editdlrm
posixpath.py131190644editdlrm
posixpath.pyc111880644editdlrm
posixpath.pyo111880644editdlrm
pprint.py119320644editdlrm
pprint.pyc103940644editdlrm
pprint.pyo102190644editdlrm
profile.py235100755editdlrm
profile.pyc166800644editdlrm
profile.pyo164350644editdlrm
pstats.py273100644editdlrm
pstats.pyc253400644editdlrm
pstats.pyo253400644editdlrm
pty.py48690644editdlrm
pty.pyc49190644editdlrm
pty.pyo49190644editdlrm
pyclbr.py132820644editdlrm
pyclbr.pyc97320644editdlrm
pyclbr.pyo97320644editdlrm
pydoc.py924320755editdlrm
pydoc.pyc910520644editdlrm
pydoc.pyo909840644editdlrm
pydoc_topics.py4231260644editdlrm
pydoc_topics.pyc4075880644editdlrm
pydoc_topics.pyo4075880644editdlrm
py_compile.py56330644editdlrm
py_compile.pyc65540644editdlrm
py_compile.pyo65540644editdlrm
Queue.py85740644editdlrm
Queue.pyc94470644editdlrm
Queue.pyo94470644editdlrm
quopri.py69720755editdlrm
quopri.pyc66880644editdlrm
quopri.pyo66880644editdlrm
random.py319660644editdlrm
random.pyc251060644editdlrm
random.pyo251060644editdlrm
re.py129660644editdlrm
re.pyc131640644editdlrm
re.pyo131640644editdlrm
repr.py42960644editdlrm
repr.pyc54340644editdlrm
repr.pyo54340644editdlrm
rexec.py201520644editdlrm
rexec.pyc242200644editdlrm
rexec.pyo242200644editdlrm
rfc822.py332950644editdlrm
rfc822.pyc321100644editdlrm
rfc822.pyo321100644editdlrm
rlcompleter.py58660644editdlrm
rlcompleter.pyc60730644editdlrm
rlcompleter.pyo60730644editdlrm
robotparser.py70140644editdlrm
robotparser.pyc78520644editdlrm
robotparser.pyo78520644editdlrm
runpy.py54130644editdlrm
runpy.pyc39790644editdlrm
runpy.pyo39790644editdlrm
sched.py50910644editdlrm
sched.pyc50050644editdlrm
sched.pyo50050644editdlrm
sets.py190500644editdlrm
sets.pyc169970644editdlrm
sets.pyo169970644editdlrm
sgmllib.py178840644editdlrm
sgmllib.pyc155980644editdlrm
sgmllib.pyo155980644editdlrm
sha.py4450644editdlrm
sha.pyc4210644editdlrm
sha.pyo4210644editdlrm
shelve.py80780644editdlrm
shelve.pyc102960644editdlrm
shelve.pyo102960644editdlrm
shlex.py111370644editdlrm
shlex.pyc77100644editdlrm
shlex.pyo77100644editdlrm
shutil.py86320644editdlrm
shutil.pyc95550644editdlrm
shutil.pyo95550644editdlrm
SimpleHTTPServer.py74220644editdlrm
SimpleHTTPServer.pyc77660644editdlrm
SimpleHTTPServer.pyo77660644editdlrm
SimpleXMLRPCServer.py219920644editdlrm
SimpleXMLRPCServer.pyc196330644editdlrm
SimpleXMLRPCServer.pyo196330644editdlrm
site.py191870644editdlrm
site.pyc188250644editdlrm
site.pyo188250644editdlrm
smtpd.py189200755editdlrm
smtpd.pyc161880644editdlrm
smtpd.pyo161880644editdlrm
smtplib.py309240755editdlrm
smtplib.pyc297370644editdlrm
smtplib.pyo297370644editdlrm
sndhdr.py59730644editdlrm
sndhdr.pyc74200644editdlrm
sndhdr.pyo74200644editdlrm
socket.py201490644editdlrm
socket.pyc161290644editdlrm
socket.pyo160440644editdlrm
SocketServer.py223260644editdlrm
SocketServer.pyc231430644editdlrm
SocketServer.pyo231430644editdlrm
sre.py3840644editdlrm
sre.pyc5190644editdlrm
sre.pyo5190644editdlrm
sre_compile.py165070644editdlrm
sre_compile.pyc114830644editdlrm
sre_compile.pyo113700644editdlrm
sre_constants.py71370644editdlrm
sre_constants.pyc60930644editdlrm
sre_constants.pyo60930644editdlrm
sre_parse.py268780644editdlrm
sre_parse.pyc196960644editdlrm
sre_parse.pyo196960644editdlrm
ssl.py166770644editdlrm
ssl.pyc142760644editdlrm
ssl.pyo142760644editdlrm
stat.py17180644editdlrm
stat.pyc27030644editdlrm
stat.pyo27030644editdlrm
statvfs.py8980644editdlrm
statvfs.pyc6200644editdlrm
statvfs.pyo6200644editdlrm
string.py207450644editdlrm
string.pyc200660644editdlrm
string.pyo200660644editdlrm
StringIO.py106210644editdlrm
StringIO.pyc115320644editdlrm
StringIO.pyo115320644editdlrm
stringold.py124490644editdlrm
stringold.pyc125930644editdlrm
stringold.pyo125930644editdlrm
stringprep.py135220644editdlrm
stringprep.pyc145260644editdlrm
stringprep.pyo144520644editdlrm
struct.py820644editdlrm
struct.pyc2390644editdlrm
struct.pyo2390644editdlrm
subprocess.py579450644editdlrm
subprocess.pyc410710644editdlrm
subprocess.pyo410140644editdlrm
sunau.py165370644editdlrm
sunau.pyc180720644editdlrm
sunau.pyo180720644editdlrm
sunaudio.py13990644editdlrm
sunaudio.pyc19970644editdlrm
sunaudio.pyo19970644editdlrm
symbol.py20500755editdlrm
symbol.pyc30250644editdlrm
symbol.pyo30250644editdlrm
symtable.py79110644editdlrm
symtable.pyc126090644editdlrm
symtable.pyo124790644editdlrm
tabnanny.py113390755editdlrm
tabnanny.pyc83330644editdlrm
tabnanny.pyo83330644editdlrm
tarfile.py877860644editdlrm
tarfile.pyc739220644editdlrm
tarfile.pyo739220644editdlrm
telnetlib.py218080644editdlrm
telnetlib.pyc199130644editdlrm
telnetlib.pyo199130644editdlrm
tempfile.py177740644editdlrm
tempfile.pyc195710644editdlrm
tempfile.pyo195710644editdlrm
textwrap.py168890644editdlrm
textwrap.pyc117920644editdlrm
textwrap.pyo117000644editdlrm
this.py10020644editdlrm
this.pyc12410644editdlrm
this.pyo12410644editdlrm
threading.py318080644editdlrm
threading.pyc281520644editdlrm
threading.pyo260800644editdlrm
timeit.py120030644editdlrm
timeit.pyc118270644editdlrm
timeit.pyo118270644editdlrm
toaiff.py31420644editdlrm
toaiff.pyc31340644editdlrm
toaiff.pyo31340644editdlrm
token.py29470755editdlrm
token.pyc38400644editdlrm
token.pyo38400644editdlrm
tokenize.py163260644editdlrm
tokenize.pyc140180644editdlrm
tokenize.pyo139250644editdlrm
trace.py303250644editdlrm
trace.pyc230510644editdlrm
trace.pyo229890644editdlrm
traceback.py112110644editdlrm
traceback.pyc116770644editdlrm
traceback.pyo116770644editdlrm
tty.py8790644editdlrm
tty.pyc13170644editdlrm
tty.pyo13170644editdlrm
types.py23230644editdlrm
types.pyc26200644editdlrm
types.pyo26200644editdlrm
unittest.py311570644editdlrm
unittest.pyc348620644editdlrm
unittest.pyo348620644editdlrm
urllib.py590220644editdlrm
urllib.pyc513480644editdlrm
urllib.pyo512540644editdlrm
urllib2.py508660644editdlrm
urllib2.pyc458130644editdlrm
urllib2.pyo457190644editdlrm
urlparse.py156180644editdlrm
urlparse.pyc147770644editdlrm
urlparse.pyo147770644editdlrm
user.py16270644editdlrm
user.pyc17360644editdlrm
user.pyo17360644editdlrm
UserDict.py57780644editdlrm
UserDict.pyc88920644editdlrm
UserDict.pyo88920644editdlrm
UserList.py36440644editdlrm
UserList.pyc66030644editdlrm
UserList.pyo66030644editdlrm
UserString.py96910755editdlrm
UserString.pyc149220644editdlrm
UserString.pyo149220644editdlrm
uu.py59420755editdlrm
uu.pyc42370644editdlrm
uu.pyo42370644editdlrm
uuid.py209440644editdlrm
uuid.pyc212790644editdlrm
uuid.pyo212790644editdlrm
warnings.py141720644editdlrm
warnings.pyc130420644editdlrm
warnings.pyo122050644editdlrm
wave.py179520644editdlrm
wave.pyc194360644editdlrm
wave.pyo194360644editdlrm
weakref.py100870644editdlrm
weakref.pyc133750644editdlrm
weakref.pyo133750644editdlrm
webbrowser.py210730644editdlrm
webbrowser.pyc187550644editdlrm
webbrowser.pyo187080644editdlrm
whichdb.py33530644editdlrm
whichdb.pyc22470644editdlrm
whichdb.pyo22470644editdlrm
xdrlib.py55130644editdlrm
xdrlib.pyc91570644editdlrm
xdrlib.pyo91570644editdlrm
xmllib.py348650644editdlrm
xmllib.pyc272740644editdlrm
xmllib.pyo272740644editdlrm
xmlrpclib.py477750644editdlrm
xmlrpclib.pyc414960644editdlrm
xmlrpclib.pyo413130644editdlrm
zipfile.py530920644editdlrm
zipfile.pyc376520644editdlrm
zipfile.pyo376520644editdlrm
_abcoll.py142420644editdlrm
_abcoll.pyc215910644editdlrm
_abcoll.pyo215910644editdlrm
_LWPCookieJar.py65530644editdlrm
_LWPCookieJar.pyc56010644editdlrm
_LWPCookieJar.pyo56010644editdlrm
_MozillaCookieJar.py58090644editdlrm
_MozillaCookieJar.pyc45170644editdlrm
_MozillaCookieJar.pyo44760644editdlrm
_strptime.py197540644editdlrm
_strptime.pyc149660644editdlrm
_strptime.pyo149660644editdlrm
_threading_local.py71140644editdlrm
_threading_local.pyc63850644editdlrm
_threading_local.pyo63850644editdlrm
__future__.py43800644editdlrm
__future__.pyc42330644editdlrm
__future__.pyo42330644editdlrm
__phello__.foo.py640644editdlrm
__phello__.foo.pyc1250644editdlrm
__phello__.foo.pyo1250644editdlrm
Edit: /usr/lib64/python2.6/BaseHTTPServer.py (21974B)
"""HTTP server base class. Note: the class in this module doesn't implement any HTTP request; see SimpleHTTPServer for simple implementations of GET, HEAD and POST (including CGI scripts). It does, however, optionally implement HTTP/1.1 persistent connections, as of version 0.3. Contents: - BaseHTTPRequestHandler: HTTP request handler base class - test: test function XXX To do: - log requests even later (to capture byte count) - log user-agent header and other interesting goodies - send error log to separate file """ # See also: # # HTTP Working Group T. Berners-Lee # INTERNET-DRAFT R. T. Fielding # H. Frystyk Nielsen # Expires September 8, 1995 March 8, 1995 # # URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt # # and # # Network Working Group R. Fielding # Request for Comments: 2616 et al # Obsoletes: 2068 June 1999 # Category: Standards Track # # URL: http://www.faqs.org/rfcs/rfc2616.html # Log files # --------- # # Here's a quote from the NCSA httpd docs about log file format. # # | The logfile format is as follows. Each line consists of: # | # | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb # | # | host: Either the DNS name or the IP number of the remote client # | rfc931: Any information returned by identd for this person, # | - otherwise. # | authuser: If user sent a userid for authentication, the user name, # | - otherwise. # | DD: Day # | Mon: Month (calendar name) # | YYYY: Year # | hh: hour (24-hour format, the machine's timezone) # | mm: minutes # | ss: seconds # | request: The first line of the HTTP request as sent by the client. # | ddd: the status code returned by the server, - if not available. # | bbbb: the total number of bytes sent, # | *not including the HTTP/1.0 header*, - if not available # | # | You can determine the name of the file accessed through request. # # (Actually, the latter is only true if you know the server configuration # at the time the request was made!) __version__ = "0.3" __all__ = ["HTTPServer", "BaseHTTPRequestHandler"] import sys import time import socket # For gethostbyaddr() from warnings import filterwarnings, catch_warnings with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*mimetools has been removed", DeprecationWarning) import mimetools import SocketServer # Default error message template DEFAULT_ERROR_MESSAGE = """\ Error response

Error response

Error code %(code)d.

Message: %(message)s.

Error code explanation: %(code)s = %(explain)s. """ DEFAULT_ERROR_CONTENT_TYPE = "text/html" def _quote_html(html): return html.replace("&", "&").replace("<", "<").replace(">", ">") class HTTPServer(SocketServer.TCPServer): allow_reuse_address = 1 # Seems to make sense in testing environment def server_bind(self): """Override server_bind to store the server name.""" SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname()[:2] self.server_name = socket.getfqdn(host) self.server_port = port class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): """HTTP request handler base class. The following explanation of HTTP serves to guide you through the code as well as to expose any misunderstandings I may have about HTTP (so you don't need to read the code to figure out I'm wrong :-). HTTP (HyperText Transfer Protocol) is an extensible protocol on top of a reliable stream transport (e.g. TCP/IP). The protocol recognizes three parts to a request: 1. One line identifying the request type and path 2. An optional set of RFC-822-style headers 3. An optional data part The headers and data are separated by a blank line. The first line of the request has the form where is a (case-sensitive) keyword such as GET or POST, is a string containing path information for the request, and should be the string "HTTP/1.0" or "HTTP/1.1". is encoded using the URL encoding scheme (using %xx to signify the ASCII character with hex code xx). The specification specifies that lines are separated by CRLF but for compatibility with the widest range of clients recommends servers also handle LF. Similarly, whitespace in the request line is treated sensibly (allowing multiple spaces between components and allowing trailing whitespace). Similarly, for output, lines ought to be separated by CRLF pairs but most clients grok LF characters just fine. If the first line of the request has the form (i.e. is left out) then this is assumed to be an HTTP 0.9 request; this form has no optional headers and data part and the reply consists of just the data. The reply form of the HTTP 1.x protocol again has three parts: 1. One line giving the response code 2. An optional set of RFC-822-style headers 3. The data Again, the headers and data are separated by a blank line. The response code line has the form where is the protocol version ("HTTP/1.0" or "HTTP/1.1"), is a 3-digit response code indicating success or failure of the request, and is an optional human-readable string explaining what the response code means. This server parses the request and the headers, and then calls a function specific to the request type (). Specifically, a request SPAM will be handled by a method do_SPAM(). If no such method exists the server sends an error response to the client. If it exists, it is called with no arguments: do_SPAM() Note that the request name is case sensitive (i.e. SPAM and spam are different requests). The various request details are stored in instance variables: - client_address is the client IP address in the form (host, port); - command, path and version are the broken-down request line; - headers is an instance of mimetools.Message (or a derived class) containing the header information; - rfile is a file object open for reading positioned at the start of the optional input data part; - wfile is a file object open for writing. IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING! The first thing to be written must be the response line. Then follow 0 or more header lines, then a blank line, and then the actual data (if any). The meaning of the header lines depends on the command executed by the server; in most cases, when data is returned, there should be at least one header line of the form Content-type: / where and should be registered MIME types, e.g. "text/html" or "text/plain". """ # The Python system version, truncated to its first component. sys_version = "Python/" + sys.version.split()[0] # The server software version. You may want to override this. # The format is multiple whitespace-separated strings, # where each string is of the form name[/version]. server_version = "BaseHTTP/" + __version__ # The default request version. This only affects responses up until # the point where the request line is parsed, so it mainly decides what # the client gets back when sending a malformed request line. # Most web servers default to HTTP 0.9, i.e. don't send a status line. default_request_version = "HTTP/0.9" def parse_request(self): """Parse a request (internal). The request should be stored in self.raw_requestline; the results are in self.command, self.path, self.request_version and self.headers. Return True for success, False for failure; on failure, an error is sent back. """ self.command = None # set in case of error on the first line self.request_version = version = self.default_request_version self.close_connection = 1 requestline = self.raw_requestline if requestline[-2:] == '\r\n': requestline = requestline[:-2] elif requestline[-1:] == '\n': requestline = requestline[:-1] self.requestline = requestline words = requestline.split() if len(words) == 3: [command, path, version] = words if version[:5] != 'HTTP/': self.send_error(400, "Bad request version (%r)" % version) return False try: base_version_number = version.split('/', 1)[1] version_number = base_version_number.split(".") # RFC 2145 section 3.1 says there can be only one "." and # - major and minor numbers MUST be treated as # separate integers; # - HTTP/2.4 is a lower version than HTTP/2.13, which in # turn is lower than HTTP/12.3; # - Leading zeros MUST be ignored by recipients. if len(version_number) != 2: raise ValueError version_number = int(version_number[0]), int(version_number[1]) except (ValueError, IndexError): self.send_error(400, "Bad request version (%r)" % version) return False if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": self.close_connection = 0 if version_number >= (2, 0): self.send_error(505, "Invalid HTTP Version (%s)" % base_version_number) return False elif len(words) == 2: [command, path] = words self.close_connection = 1 if command != 'GET': self.send_error(400, "Bad HTTP/0.9 request type (%r)" % command) return False elif not words: return False else: self.send_error(400, "Bad request syntax (%r)" % requestline) return False self.command, self.path, self.request_version = command, path, version # Examine the headers and look for a Connection directive self.headers = self.MessageClass(self.rfile, 0) conntype = self.headers.get('Connection', "") if conntype.lower() == 'close': self.close_connection = 1 elif (conntype.lower() == 'keep-alive' and self.protocol_version >= "HTTP/1.1"): self.close_connection = 0 return True def handle_one_request(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline() if not self.raw_requestline: self.close_connection = 1 return if not self.parse_request(): # An error code has been sent, just exit return mname = 'do_' + self.command if not hasattr(self, mname): self.send_error(501, "Unsupported method (%r)" % self.command) return method = getattr(self, mname) method() def handle(self): """Handle multiple requests if necessary.""" self.close_connection = 1 self.handle_one_request() while not self.close_connection: self.handle_one_request() def send_error(self, code, message=None): """Send and log an error reply. Arguments are the error code, and a detailed message. The detailed message defaults to the short entry matching the response code. This sends an error response (so it must be called before any output has been generated), logs the error, and finally sends a piece of HTML explaining the error to the user. """ try: short, long = self.responses[code] except KeyError: short, long = '???', '???' if message is None: message = short explain = long self.log_error("code %d, message %s", code, message) # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201) content = (self.error_message_format % {'code': code, 'message': _quote_html(message), 'explain': explain}) self.send_response(code, message) self.send_header("Content-Type", self.error_content_type) self.send_header('Connection', 'close') self.end_headers() if self.command != 'HEAD' and code >= 200 and code not in (204, 304): self.wfile.write(content) error_message_format = DEFAULT_ERROR_MESSAGE error_content_type = DEFAULT_ERROR_CONTENT_TYPE def send_response(self, code, message=None): """Send the response header and log the response code. Also send two standard headers with the server software version and the current date. """ self.log_request(code) if message is None: if code in self.responses: message = self.responses[code][0] else: message = '' if self.request_version != 'HTTP/0.9': self.wfile.write("%s %d %s\r\n" % (self.protocol_version, code, message)) # print (self.protocol_version, code, message) self.send_header('Server', self.version_string()) self.send_header('Date', self.date_time_string()) def send_header(self, keyword, value): """Send a MIME header.""" if self.request_version != 'HTTP/0.9': self.wfile.write("%s: %s\r\n" % (keyword, value)) if keyword.lower() == 'connection': if value.lower() == 'close': self.close_connection = 1 elif value.lower() == 'keep-alive': self.close_connection = 0 def end_headers(self): """Send the blank line ending the MIME headers.""" if self.request_version != 'HTTP/0.9': self.wfile.write("\r\n") def log_request(self, code='-', size='-'): """Log an accepted request. This is called by send_response(). """ self.log_message('"%s" %s %s', self.requestline, str(code), str(size)) def log_error(self, format, *args): """Log an error. This is called when a request cannot be fulfilled. By default it passes the message on to log_message(). Arguments are the same as for log_message(). XXX This should go to the separate error log. """ self.log_message(format, *args) def log_message(self, format, *args): """Log an arbitrary message. This is used by all other logging functions. Override it if you have specific logging wishes. The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it's just like printf!). The client host and current date/time are prefixed to every message. """ sys.stderr.write("%s - - [%s] %s\n" % (self.address_string(), self.log_date_time_string(), format%args)) def version_string(self): """Return the server software version string.""" return self.server_version + ' ' + self.sys_version def date_time_string(self, timestamp=None): """Return the current date and time formatted for a message header.""" if timestamp is None: timestamp = time.time() year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp) s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( self.weekdayname[wd], day, self.monthname[month], year, hh, mm, ss) return s def log_date_time_string(self): """Return the current time formatted for logging.""" now = time.time() year, month, day, hh, mm, ss, x, y, z = time.localtime(now) s = "%02d/%3s/%04d %02d:%02d:%02d" % ( day, self.monthname[month], year, hh, mm, ss) return s weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] def address_string(self): """Return the client address formatted for logging. This version looks up the full hostname using gethostbyaddr(), and tries to find a name that contains at least one dot. """ host, port = self.client_address[:2] return socket.getfqdn(host) # Essentially static class variables # The version of the HTTP protocol we support. # Set this to HTTP/1.1 to enable automatic keepalive protocol_version = "HTTP/1.0" # The Message-like class used to parse headers MessageClass = mimetools.Message # Table mapping response codes to messages; entries have the # form {code: (shortmessage, longmessage)}. # See RFC 2616. responses = { 100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), 301: ('Moved Permanently', 'Object moved permanently -- see URI list'), 302: ('Found', 'Object moved temporarily -- see URI list'), 303: ('See Other', 'Object moved -- see Method and URL list'), 304: ('Not Modified', 'Document has not changed since given time'), 305: ('Use Proxy', 'You must use proxy specified in Location to access this ' 'resource.'), 307: ('Temporary Redirect', 'Object moved temporarily -- see URI list'), 400: ('Bad Request', 'Bad request syntax or unsupported method'), 401: ('Unauthorized', 'No permission -- see authorization schemes'), 402: ('Payment Required', 'No payment -- see charging schemes'), 403: ('Forbidden', 'Request forbidden -- authorization will not help'), 404: ('Not Found', 'Nothing matches the given URI'), 405: ('Method Not Allowed', 'Specified method is invalid for this resource.'), 406: ('Not Acceptable', 'URI not available in preferred format.'), 407: ('Proxy Authentication Required', 'You must authenticate with ' 'this proxy before proceeding.'), 408: ('Request Timeout', 'Request timed out; try again later.'), 409: ('Conflict', 'Request conflict.'), 410: ('Gone', 'URI no longer exists and has been permanently removed.'), 411: ('Length Required', 'Client must specify Content-Length.'), 412: ('Precondition Failed', 'Precondition in headers is false.'), 413: ('Request Entity Too Large', 'Entity is too large.'), 414: ('Request-URI Too Long', 'URI is too long.'), 415: ('Unsupported Media Type', 'Entity body in unsupported format.'), 416: ('Requested Range Not Satisfiable', 'Cannot satisfy request range.'), 417: ('Expectation Failed', 'Expect condition could not be satisfied.'), 500: ('Internal Server Error', 'Server got itself in trouble'), 501: ('Not Implemented', 'Server does not support this operation'), 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'), 503: ('Service Unavailable', 'The server cannot process the request due to a high load'), 504: ('Gateway Timeout', 'The gateway server did not receive a timely response'), 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'), } def test(HandlerClass = BaseHTTPRequestHandler, ServerClass = HTTPServer, protocol="HTTP/1.0"): """Test the HTTP request handler class. This runs an HTTP server on port 8000 (or the first command line argument). """ if sys.argv[1:]: port = int(sys.argv[1]) else: port = 8000 server_address = ('', port) HandlerClass.protocol_version = protocol httpd = ServerClass(server_address, HandlerClass) sa = httpd.socket.getsockname() print "Serving HTTP on", sa[0], "port", sa[1], "..." httpd.serve_forever() if __name__ == '__main__': test()