| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
For use by issue3972.
|
| |
|
|
|
|
|
| |
properly handles EINTR within the read, readline, write & flush methods.
The socket.sendall() method now properly handles interrupted system calls.
|
|
|
|
| |
Fix O(n**2) performance problem in socket._fileobject
|
| |
|
| |
|
| |
|
|
|
|
| |
object. This removes all warnings for the module caused by running under -3.
|
|
|
|
|
|
| |
all the upper level libraries that use it, including urllib2.
Added and fixed some tests, and changed docs correspondingly.
Thanks to John J Lee for the patch and the pusing, :)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An assertion in readline() would fail as data was already in the
internal buffer even though the socket was in unbuffered read mode.
That case is now handled. More importantly, read() has been fixed to
not over-recv() and leave newly recv()d data in the _fileobject buffer.
The max() vs min() issue in read() is now gone. Neither was correct.
On bounded reads, always ask recv() for the exact amount of data we
still need.
Candidate for backporting to release25-maint along with r62627.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
problems is in the bug report (one old, one recently introduced trying
to fix the old one). In short:
buffer data during socket._fileobject.read() and readlines() within a
cStringIO object instead of a [] of str()s returned from the recv()
call.
This prevents excessive memory use due to the size parameter being
passed to recv() being grossly larger than the actual size of the data
returned *and* prevents excessive cpu usage due to looping in python
calling recv() with a very tiny size value if min() is used as the
previous memory-use bug "fix" did.
It also documents what the socket._fileobject._rbufsize member is
actually used for.
This is a candidate for back porting to 2.5.
|
|
|
|
| |
socket
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Much expanded test suite:
All protocols tested against all other protocols.
All protocols tested with all certificate options.
Tests for bad key and bad cert.
Test of STARTTLS functionality.
Test of RAND_* functions.
* Fixes for threading/malloc bug.
* Issue 1065 fixed:
sslsocket class renamed to SSLSocket.
sslerror class renamed to SSLError.
Function "wrap_socket" now used to wrap an existing socket.
* Issue 1583946 finally fixed:
Support for subjectAltName added.
Subject name now returned as proper DN list of RDNs.
* SSLError exported from socket as "sslerror".
* RAND_* functions properly exported from ssl.py.
* Documentation improved:
Example of how to create a self-signed certificate.
Better indexing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Improve the documentation of the SSL module, with a fuller
explanation of certificate usage, another reference, proper
formatting of this and that.
2) Fix Windows bug in ssl.py, and general bug in sslsocket.close().
Remove some unused code from ssl.py. Allow accept() to be called on
sslsocket sockets.
3) Use try-except-else in import of ssl in socket.py. Deprecate use of
socket.ssl().
4) Remove use of socket.ssl() in every library module, except for
test_socket_ssl.py and test_ssl.py.
|
|
|
|
|
| |
While cleaning up Bill's C style, I may have cleaned up some code
he didn't touch as well (in _ssl.c).
|
| |
|
|
|
|
| |
You might want to review this change as it's my first time. Be gentle. :-)
|
|
|
|
|
| |
connection with an optional timeout, and modified httplib.py to
use this function in HTTPConnection. Applies patch 1676823.
|
|
|
|
| |
Will backport.
|
| |
|
|
|
|
|
| |
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Following Guido's comments, renamed
* pack_to -> pack_into
* recv_buf -> recv_into
* recvfrom_buf -> recvfrom_into
- Made fixes to _struct.c according to Neal Norwitz comments on the checkins
list.
- Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
|
|
|
|
|
|
|
|
|
|
| |
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
|
| |
|
| |
|
|
|
|
| |
properties.
|
|
|
|
| |
now exposed via new get...() methods.
|
|
|
|
|
|
|
| |
socket.gethostname() in the check for a valid return.
Also clarified docs (official and docstring) that the value from gethostname()
is returned if gethostbyaddr() doesn't do the job.
|
| |
|
| |
|
|
|
|
|
|
| |
The .closed property always returned the wrong result.
Bugfix candidate!
|
|
|
|
| |
Fixes #754447.
|
|
|
|
|
| |
can happen if __init__ doesn't complete. Fix it by adding a
try/except to __del__.
|
|
|
|
| |
riscospath.extsep, and use os.extsep throughout.
|
| |
|
|
|
|
|
| |
throughput-sensitive methods are grabbed from the underlying _socket.socket
object. Closes SF patch 729293.
|
|
|
|
|
|
|
|
|
| |
- The socket module now provides the functions inet_pton and inet_ntop
for converting between string and packed representation of IP addresses.
See SF patch #658327.
This still needs a bit of work in the doc area, because it is not
available on all platforms (especially not on Windows).
|
|
|
|
|
|
|
|
|
| |
platforms which have dup(2). The makefile() method is built directly on top
of the socket without duplicating the file descriptor, allowing timeouts to
work properly. Includes a new test case (urllibnet) which requires the
network resource.
Closes bug 707074.
|
|
|
|
| |
598097)
|
| |
|
|
|
|
|
|
|
| |
to delete the reference to self._sock, and the regular destructor will
do that just fine. This made some hacks in close() unnecessary.
The _fileobject class still has a __del__ method, because it must flush.
|
|
|
|
| |
This is important IMO because httplib reads the headers this way.
|
|
|
|
|
|
|
|
| |
observation that _rbuf could never have more than one string in it.
So make _rbuf a string. The code branches for size<0 and size>=0
are completely separate now, both in read() and in readline().
I checked for tabs this time. :-)
|
| |
|
| |
|