Lines 98-103
Link Here
|
98 |
password = None |
98 |
password = None |
99 |
del userpass |
99 |
del userpass |
100 |
|
100 |
|
|
|
101 |
hostport = string.split(host, ":", 1) |
102 |
if len(hostport) == 2: |
103 |
host = hostport[0] |
104 |
port = hostport[1] |
105 |
else: |
106 |
port = None |
107 |
del hostport |
108 |
|
101 |
http_headers = {} |
109 |
http_headers = {} |
102 |
http_params = {} |
110 |
http_params = {} |
103 |
if username and password: |
111 |
if username and password: |
Lines 112-126
Link Here
|
112 |
|
120 |
|
113 |
if not conn: |
121 |
if not conn: |
114 |
if protocol == "https": |
122 |
if protocol == "https": |
115 |
conn = httplib.HTTPSConnection(host) |
123 |
conn = httplib.HTTPSConnection(host, port) |
116 |
elif protocol == "http": |
124 |
elif protocol == "http": |
117 |
conn = httplib.HTTPConnection(host) |
125 |
conn = httplib.HTTPConnection(host, port) |
118 |
elif protocol == "ftp": |
126 |
elif protocol == "ftp": |
119 |
passive = 0 |
127 |
passive = 0 |
120 |
if(host[-1] == "*"): |
128 |
if(host[-1] == "*"): |
121 |
passive = 1 |
129 |
passive = 1 |
122 |
host = host[:-1] |
130 |
host = host[:-1] |
123 |
conn = ftplib.FTP(host) |
131 |
conn = ftplib.FTP() |
|
|
132 |
conn.connect(host, port) |
124 |
if password: |
133 |
if password: |
125 |
conn.login(username,password) |
134 |
conn.login(username,password) |
126 |
else: |
135 |
else: |