--- /usr/lib64/python2.4/
httplib.py 2009-09-04 03:38:18.000000000 +0800
+++ /usr/lib64/python2.4/
httplib.py 2010-07-06 18:07:18.000000000 +0800
@@ -156,6 +156,7 @@
# maximal amount of data to read at one time in _safe_read
MAXAMOUNT = 1048576
+Local_BindIP = None
class HTTPMessage(mimetools.Message):
def addheader(self, key, value):
@@ -621,6 +622,8 @@
af, socktype, proto, canonname, sa = res
try:
self.sock = socket.socket(af, socktype, proto)
+ if Local_BindIP is not None:
+ self.sock.bind((Local_BindIP,0))
if self.debuglevel > 0:
print "connect: (%s, %s)" % (self.host, self.port)
self.sock.connect(sa)