| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11490/root/usr/lib/python2.6/ |
Upload File : |
Ñò
ÇÉŽJc @ s¼ d Z d Z d g Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d e i f d „ ƒ YZ
e a d „ Z
d „ Z e
e i d „ Z e d j o e ƒ n d S(
sú CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.
In all cases, the implementation is intentionally naive -- all
requests are executed sychronously.
SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.
Note that status code 200 is sent prior to execution of a CGI script, so
scripts cannot send other status codes such as 302 (redirect).
s 0.4t CGIHTTPRequestHandleriÿÿÿÿNc B sƒ e Z d Z e e d ƒ Z e e d ƒ Z e e d ƒ Z d Z d „ Z d „ Z
d „ Z d d g Z d
„ Z
d „ Z d „ Z RS(
s Complete HTTP server with GET, HEAD and POST commands.
GET and HEAD also support running CGI scripts.
The POST command is *only* implemented for CGI scripts.
t forkt popen2t popen3i c C s/ | i ƒ o | i ƒ n | i d d ƒ d S( sR Serve a POST request.
This is only implemented for CGI scripts.
iõ s Can only POST to CGI scriptsN( t is_cgit run_cgit
send_error( t self( ( s# /usr/lib/python2.6/CGIHTTPServer.pyt do_POST5 s
c C s, | i ƒ o | i ƒ St i i | ƒ Sd S( s- Version of send_head that support CGI scriptsN( R R t SimpleHTTPServert SimpleHTTPRequestHandlert send_head( R ( ( s# /usr/lib/python2.6/CGIHTTPServer.pyR A s
c C s{ | i } xk | i D]` } t | ƒ } | | | j o= | | p | | d j o | | | | d f | _ t Sq Wt S( s Test whether self.path corresponds to a CGI script,
and return a boolean.
This function sets self.cgi_info to a tuple (dir, rest)
when it returns True, where dir is the directory part before
the CGI script name. Note that rest begins with a
slash if it is not empty.
The default implementation tests whether the path
begins with one of the strings in the list
self.cgi_directories (and the next character is a '/'
or the end of the string).
t /i ( t patht cgi_directoriest lent cgi_infot Truet False( R R
t xt i( ( s# /usr/lib/python2.6/CGIHTTPServer.pyR H s
. s /cgi-bins /htbinc C s
t | ƒ S( s1 Test whether argument path is an executable file.( t
executable( R R
( ( s# /usr/lib/python2.6/CGIHTTPServer.pyt
is_executableb s c C s( t i i | ƒ \ } } | i ƒ d j S( s. Test whether argument path is a Python script.s .pys .pyw( s .pys .pyw( t osR
t splitextt lower( R R
t headt tail( ( s# /usr/lib/python2.6/CGIHTTPServer.pyt is_pythonf s c / C s”
| i } | i \ } } | i d t | ƒ d ƒ } xz | d j ol | | } | | d } | i | ƒ } t i i | ƒ o- | | } } | i d t | ƒ d ƒ } q7 Pq7 W| i d ƒ } | d j o | | | | d } } n d } | i d ƒ } | d j o | | | | } } n | d } } | d | }
| i |
ƒ } t i i | ƒ p | i d d |
ƒ d St i i
| ƒ p | i d d
|
ƒ d S| i |
ƒ } | pd | i p | i
p | i p | i d d |
ƒ d S| i | ƒ p | i d d |
ƒ d Sn h }
| i ƒ |
d
<| i i |
d <d |
d <| i |
d <t | i i ƒ |
d <| i |
d <t i | ƒ } | |
d <| i | ƒ |
d <|
|
d <| o | |
d <n | i ƒ } | | i d j o | |
d <n | i d |
d <| i i d ƒ } | oÌ | i ƒ } t | ƒ d j o© d d k } d d k } | d |
d <| d i ƒ d j oh y | i! | d ƒ } Wn | i"