summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
Commit message (Collapse)AuthorAgeFilesLines
* #1389051, #1092502: fix excessively large allocations when using read() on a ↵Andrew M. Kuchling2008-02-231-1/+1
| | | | socket
* socket.ioctl is only available on WindowsChristian Heimes2008-01-041-1/+4
|
* Added interface to Windows' WSAIoctl and a simple example for a network sniffer.Christian Heimes2008-01-041-1/+1
|
* Revert dummy commit now that the build slave is building.Georg Brandl2007-12-161-1/+0
|
* Dummy commit to investigate #1617.Georg Brandl2007-12-161-0/+1
|
* More work on SSL support.Bill Janssen2007-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* This contains a number of things:Bill Janssen2007-08-291-12/+28
| | | | | | | | | | | | | | | | 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.
* Server-side SSL and certificate validation, by Bill Janssen.Guido van Rossum2007-08-251-4/+3
| | | | | While cleaning up Bill's C style, I may have cleaned up some code he didn't touch as well (in _ssl.c).
* Bug #978833: Close https sockets by releasing the _ssl object.Martin v. Löwis2007-07-271-0/+4
|
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-5/+5
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Added a 'create_connect()' function to socket.py, which creates aFacundo Batista2007-03-231-0/+29
| | | | | connection with an optional timeout, and modified httplib.py to use this function in HTTPConnection. Applies patch 1676823.
* Bug #978833: Revert r50844, as it broke _socketobject.dup.Martin v. Löwis2007-03-231-3/+0
| | | | Will backport.
* Patch #1627441: close sockets properly in urllib2.Georg Brandl2007-01-211-2/+6
|
* Bug #978833: Really close underlying socket in _socketobject.close.Martin v. Löwis2006-07-261-0/+3
| | | | | Fix httplib.HTTPConnection.getresponse to not close the socket if it is still needed for the response.
* Release all forwarded functions in .close. Fixes #1513223.Martin v. Löwis2006-07-011-12/+14
|
* Fixes in struct and socket from merge reviews.Martin Blais2006-06-041-3/+3
| | | | | | | | | | | | | - 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.
* Support for buffer protocol for socket and struct.Martin Blais2006-05-261-1/+5
| | | | | | | | | | * 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.
* Patch #1466993: remove wrong comment in socket.pyGeorg Brandl2006-04-091-8/+0
|
* Whitespace normalization.Tim Peters2006-03-221-1/+1
|
* Correct API design mistake from rev. 43126: make socket attributes readonly ↵Georg Brandl2006-03-211-18/+4
| | | | properties.
* RFE #567972: Socket objects' family, type and proto properties areGeorg Brandl2006-03-171-0/+18
| | | | now exposed via new get...() methods.
* Fix test for socket.getfqdn() to also include the name returned byBrett Cannon2005-03-111-1/+1
| | | | | | | 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.
* Patch #1003700: Add socketpair function to socket module.Dave Cole2004-08-091-0/+1
|
* Add weakref support to sockets and re pattern objects.Raymond Hettinger2004-05-311-1/+2
|
* SF bug 924242: socket._fileobject._getclosed() returns wrong valueTim Peters2004-03-281-1/+1
| | | | | | The .closed property always returned the wrong result. Bugfix candidate!
* Always unwrap _socketobj in socket.ssl. Revert httplib.py 1.25.Martin v. Löwis2003-06-141-10/+6
| | | | Fixes #754447.
* I saw errors from _fileobject.__del__ about missing self._sock. ThisGuido van Rossum2003-05-291-1/+5
| | | | | can happen if __init__ doesn't complete. Fix it by adding a try/except to __del__.
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-101-1/+3
| | | | riscospath.extsep, and use os.extsep throughout.
* Extract the errno value to use from the errno module if possible.Fred Drake2003-04-291-1/+6
|
* Regain throughput lost with the _socketobject wrapper. TheSkip Montanaro2003-04-291-3/+9
| | | | | throughput-sensitive methods are grabbed from the underlying _socket.socket object. Closes SF patch 729293.
* Patch by Jp Calderone:Guido van Rossum2003-04-251-0/+1
| | | | | | | | | - 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).
* The socket module now always uses the _socketobject wrapper class, even onSkip Montanaro2003-03-301-5/+1
| | | | | | | | | 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.
* On Windows, make sure SocketType is the same as socket. (SF bugGuido van Rossum2002-08-221-1/+1
| | | | 598097)
* Delete junk attributes left behind by _socketobject class construction.Tim Peters2002-08-081-0/+1
|
* The _socketobject class has no need for a __del__ method: all it did wasGuido van Rossum2002-08-081-10/+6
| | | | | | | 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.
* OK, one more hack: speed up the case of readline() in unbuffered mode.Guido van Rossum2002-08-081-0/+11
| | | | This is important IMO because httplib reads the headers this way.
* Another refactoring of read() and readline(), this time based on theGuido van Rossum2002-08-081-66/+88
| | | | | | | | 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. :-)
* Extend __all__ with the exports list of the _ssl module.Guido van Rossum2002-08-081-1/+4
|
* Oops, stupid tabs. Sorry again.Guido van Rossum2002-08-081-3/+3
|
* Another refactoring. Changed 'socket' from being a factory functionGuido van Rossum2002-08-081-26/+49
| | | | | | | | | | | | to being a new-style class, to be more similar to the socket class in the _socket module; it is now the same as the _socketobject class. Added __slots__. Added docstrings, copied from the real socket class where possible. The _fileobject class is now also a new-style class with __slots__ (though without docstrings). The mode, name, softspace, bufsize and closed attributes are properly supported (closed as a property; name as a class attributes; the softspace, mode and bufsize as slots).
* Major restructuring of _fileobject. Hopefully several things now workGuido van Rossum2002-08-081-61/+111
| | | | | | | | correctly (the test at least succeed, but they don't test everything yet). Also fix a performance problem in read(-1): in unbuffered mode, this would read 1 byte at a time. Since we're reading until EOF, that doesn't make sense. Use the default buffer size if _rbufsize is <= 1.
* Replace tabs with spaces. (Sorry!)Guido van Rossum2002-08-071-3/+3
|
* "Unbuffered" mode of class _fileobject wasn't actually unbuffered,Guido van Rossum2002-08-071-2/+5
| | | | | | | | | | and this broke a Zope "pipelining" test which read multiple responses from the same connection (this attaches a new file object to the socket for each response). Added a test for this too. (I want to do some code cleanup too, but I thought I'd first fix the problem with as little code as possible, and add a unit test for this case. So that's what this checkin is about.)
* Restore a full arglist to the socket wrapper, so it supports keywordTim Peters2002-07-311-2/+2
| | | | arguments correctly too.
* For platforms (like Windows) that wrap _socket.socket:Tim Peters2002-07-311-2/+3
| | | | | | + Don't change the arglist requirements. + Give the wrapper the same docstring as _socket.socket (it didn't have any docstring).
* Add default timeout functionality. This adds setdefaulttimeout() andGuido van Rossum2002-07-181-0/+2
| | | | | getdefaulttimeout() functions to the socket and _socket modules, and appropriate tests.
* Cleanup a littleNeal Norwitz2002-06-131-6/+7
|
* SF patch 555085 (timeout socket implementation) by Michael Gilfix.Guido van Rossum2002-06-061-59/+74
| | | | | | | | | | | | | I've made considerable changes to Michael's code, specifically to use the select() system call directly and to store the timeout as a C double instead of a Python object; internally, -1.0 (or anything negative) represents the None from the API. I'm not 100% sure that all corner cases are covered correctly, so please keep an eye on this. Next I'm going to try it Windows before Tim complains. No way is this a bugfix candidate. :-)
* Repair so that importing socket doesn't blow up on platforms that lackTim Peters2002-02-171-7/+12
| | | | | | | | SSL support. test_socket.py passes again on Windows. Added an XXX about adding _ssl exports to the __all__ list (it doesn't appear to be doing anything about that now, but since I don't have SSL on this box I can't really tell).
* The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.Martin v. Löwis2002-02-161-2/+2
| | | | | Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method.