Revision aea0ed67 lib/http/client.py
b/lib/http/client.py | ||
---|---|---|
167 | 167 |
http.HttpBase.__init__(self) |
168 | 168 |
self.request = req |
169 | 169 |
|
170 |
self.poller = select.poll() |
|
171 |
|
|
172 | 170 |
try: |
173 | 171 |
# TODO: Implement connection caching/keep-alive |
174 | 172 |
self.sock = self._CreateSocket(req.ssl_params, |
... | ... | |
194 | 192 |
finally: |
195 | 193 |
# TODO: Keep-alive is not supported, always close connection |
196 | 194 |
force_close = True |
197 |
http.ShutdownConnection(self.poller, self.sock,
|
|
198 |
self.CLOSE_TIMEOUT, self.WRITE_TIMEOUT,
|
|
199 |
response_msg_reader, force_close)
|
|
195 |
http.ShutdownConnection(self.sock, self.CLOSE_TIMEOUT,
|
|
196 |
self.WRITE_TIMEOUT, response_msg_reader,
|
|
197 |
force_close) |
|
200 | 198 |
|
201 | 199 |
self.sock.close() |
202 | 200 |
self.sock = None |
... | ... | |
246 | 244 |
|
247 | 245 |
if not connected: |
248 | 246 |
# Wait for connection |
249 |
event = http.WaitForSocketCondition(self.poller, self.sock,
|
|
250 |
select.POLLOUT, self.CONNECT_TIMEOUT)
|
|
247 |
event = http.WaitForSocketCondition(self.sock, select.POLLOUT,
|
|
248 |
self.CONNECT_TIMEOUT) |
|
251 | 249 |
if event is None: |
252 | 250 |
raise http.HttpError("Timeout while connecting to server") |
253 | 251 |
|
... | ... | |
268 | 266 |
if self.using_ssl: |
269 | 267 |
self.sock.set_connect_state() |
270 | 268 |
try: |
271 |
http.Handshake(self.poller, self.sock, self.WRITE_TIMEOUT)
|
|
269 |
http.Handshake(self.sock, self.WRITE_TIMEOUT) |
|
272 | 270 |
except http.HttpSessionHandshakeUnexpectedEOF: |
273 | 271 |
raise http.HttpError("Server closed connection during SSL handshake") |
274 | 272 |
|
Also available in: Unified diff