Mercurial > hg
comparison mercurial/httpclient/__init__.py @ 17424:e7cfe3587ea4
fix trivial spelling errors
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 15 Aug 2012 22:38:42 +0200 |
parents | 69af967b6d6f |
children | 72803c8edaa4 |
comparison
equal
deleted
inserted
replaced
17406:fc14953e8e34 | 17424:e7cfe3587ea4 |
---|---|
291 | 291 |
292 Args: | 292 Args: |
293 host: The host to which we'll connect. | 293 host: The host to which we'll connect. |
294 port: Optional. The port over which we'll connect. Default 80 for | 294 port: Optional. The port over which we'll connect. Default 80 for |
295 non-ssl, 443 for ssl. | 295 non-ssl, 443 for ssl. |
296 use_ssl: Optional. Wether to use ssl. Defaults to False if port is | 296 use_ssl: Optional. Whether to use ssl. Defaults to False if port is |
297 not 443, true if port is 443. | 297 not 443, true if port is 443. |
298 ssl_validator: a function(socket) to validate the ssl cert | 298 ssl_validator: a function(socket) to validate the ssl cert |
299 timeout: Optional. Connection timeout, default is TIMEOUT_DEFAULT. | 299 timeout: Optional. Connection timeout, default is TIMEOUT_DEFAULT. |
300 continue_timeout: Optional. Timeout for waiting on an expected | 300 continue_timeout: Optional. Timeout for waiting on an expected |
301 "100 Continue" response. Default is TIMEOUT_ASSUME_CONTINUE. | 301 "100 Continue" response. Default is TIMEOUT_ASSUME_CONTINUE. |
372 else: | 372 else: |
373 sock = socketutil.create_connection((self.host, self.port)) | 373 sock = socketutil.create_connection((self.host, self.port)) |
374 if self.ssl: | 374 if self.ssl: |
375 # This is the default, but in the case of proxied SSL | 375 # This is the default, but in the case of proxied SSL |
376 # requests the proxy logic above will have cleared | 376 # requests the proxy logic above will have cleared |
377 # blocking mode, so reenable it just to be safe. | 377 # blocking mode, so re-enable it just to be safe. |
378 sock.setblocking(1) | 378 sock.setblocking(1) |
379 logger.debug('wrapping socket for ssl with options %r', | 379 logger.debug('wrapping socket for ssl with options %r', |
380 self.ssl_opts) | 380 self.ssl_opts) |
381 sock = socketutil.wrap_socket(sock, **self.ssl_opts) | 381 sock = socketutil.wrap_socket(sock, **self.ssl_opts) |
382 if self._ssl_validator: | 382 if self._ssl_validator: |
412 | 412 |
413 def close(self): | 413 def close(self): |
414 """Close the connection to the server. | 414 """Close the connection to the server. |
415 | 415 |
416 This is a no-op if the connection is already closed. The | 416 This is a no-op if the connection is already closed. The |
417 connection may automatically close if requessted by the server | 417 connection may automatically close if requested by the server |
418 or required by the nature of a response. | 418 or required by the nature of a response. |
419 """ | 419 """ |
420 if self.sock is None: | 420 if self.sock is None: |
421 return | 421 return |
422 self.sock.close() | 422 self.sock.close() |