summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Release host name memory. Fixes #783312. Will backport to 2.3.Martin v. Löwis2003-08-071-6/+12
|
* Patch #781722: Reject AF_INET6 if IPv6 is disabled. Will backport to 2.3.Martin v. Löwis2003-08-051-0/+8
|
* Get socketmodule compiling on IRIX 6.5.10.Jeremy Hylton2003-07-171-2/+11
| | | | | | I don't think the fix here is very good, but I'm not sure what would be better. In particular, we should not be defining _SGIAPI, but lots of things break if we remove it.
* Fix [ 766669 ] Consistent GPF on exitMark Hammond2003-07-091-1/+1
| | | | | Use Py_AtExit instead of atexit so we are called during Py_Finalize() rather than during DLL teardown.
* SF patch #760257: add socket.timeout exceptionRaymond Hettinger2003-06-291-38/+113
| | | | | | | | | (Contributed by Bob Halley) Added a new exception, socket.timeout so that timeouts can be differentiated from other socket exceptions. Docs, more tests, and newsitem to follow.
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-101-8/+36
| | | | riscospath.extsep, and use os.extsep throughout.
* Yet another addition to [731644]: only use the lock if thread-supportJust van Rossum2003-05-091-2/+2
| | | | is enabled.
* Addition to [731644]: also use the lock when using the getaddrinfoJust van Rossum2003-05-091-2/+2
| | | | emulation (ie. when HAVE_GETADDRINFO isn't defined).
* [ 731644] & [ 604210 ] Release the GIL around getaddrinfo(), yet protectJust van Rossum2003-05-091-10/+45
| | | | | access with lock on those platforms that getaddrinfo() isn't (known to be) thread-safe. Thanks to MvL for mentoring this patch.
* Patch #724588: Check whether the address of hstrerror and inet_pton canMartin v. Löwis2003-05-031-0/+10
| | | | be taken, and define NI_MAX{HOST|SERV} if necessary.
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-031-1/+9
|
* Patch 731209: Restore socketmodule's behaviour with dotted quad addressesAnthony Baxter2003-05-021-0/+16
| | | | | to that of Python2.1. Such nnn.nnn.nnn.nnn addresses are just used directly, not passed to the resolver for a pointless lookup.
* Patch #725942: Always rename emulation functions.Martin v. Löwis2003-05-011-2/+5
|
* Patch by Jp Calderone:Guido van Rossum2003-04-251-1/+114
| | | | | | | | | - 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).
* Implement IDNA (Internationalized Domain Names in Applications).Martin v. Löwis2003-04-181-5/+25
|
* Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.Martin v. Löwis2003-03-291-1/+1
|
* The connect timeout code wasn't working on Windows.Guido van Rossum2003-02-191-12/+13
| | | | | | Rather than trying to second-guess the various error returns of a second connect(), use select() to determine whether the socket becomes writable (which means connected).
* socket_inet_aton(): ip_addr was left undefined before use in theTim Peters2003-02-131-9/+9
| | | | | !HAVE_INET_ATON case. Repaired that, and tried to repair what looked like out-of-date comments.
* Ummm, try to get it right this timeNeal Norwitz2003-02-131-1/+1
|
* Use configure to check for inet_aton.Neal Norwitz2003-02-131-1/+1
|
* Addressing SF bug #643005, implement socket.inet_aton() usingGuido van Rossum2003-02-121-1/+17
| | | | | | | | | inet_aton() rather than inet_addr() -- the latter is obsolete because it has a problem: "255.255.255.255" is a valid address but indistinguishable from an error. (I'm not sure if inet_aton() exists everywhere -- in case it doesn't, I've left the old code in with an #ifdef.)
* SF patch #678257 by Geoff Talvola.Guido van Rossum2003-01-311-1/+1
| | | | | In sendall(), do an internal select before each send() call, instead of only for the first one.
* Patch #661760: Cygwin auto-import module patchJason Tishler2003-01-061-6/+3
| | | | | | | | | | | | The attached patch enables shared extension modules to build cleanly under Cygwin without moving the static initialization of certain function pointers (i.e., ones exported from the Python DLL core) to a module initialization function. Additionally, this patch fixes the modules that have been changed in the past to accommodate Cygwin.
* OS/2 sockets do not support AF_UNIX, even though EMX headers define itAndrew MacIntyre2003-01-021-4/+4
|
* Patch #650422: Use Posix AF_ constants instead of PF_ ones.Martin v. Löwis2002-12-111-5/+7
|
* Don't include <ioctl.h> unless on __VMS.Martin v. Löwis2002-12-061-1/+3
|
* Patch #614055: Support OpenVMS.Martin v. Löwis2002-12-061-1/+106
|
* Use O_NONBLOCK rather than O_NDELAY, so we get POSIX non-blocking I/O.Neal Norwitz2002-11-021-4/+4
| | | | | | | | | | | | | On HPUX, Solaris, Tru64 (Dec UNIX), and IRIX (I think), O_NONBLOCK is the POSIX version of non-blocking I/O which is what we want. On Linux and FreeBSD (at least), O_NONBLOCK and O_NDELAY are the same. So this change should have no negative effect on those platforms. Tested on Linux, Solaris, HPUX. Thanks to Anders Qvist for diagnosing this problem.
* Patch #608999: Fix portability problems with MIPSPro 7.xMartin v. Löwis2002-09-191-0/+8
|
* Update the module doc comment.Guido van Rossum2002-09-031-1/+3
|
* SF bug #592645 fix memory leak in socket.getaddrinfoNeal Norwitz2002-08-091-0/+2
|
* The other half of the patches added to SF patch 555085 by A IGuido van Rossum2002-08-081-0/+2
| | | | | | MacIntyre. At least on OS/2, a subsequent connect() on a nonblocking socket returns errno==EISCONN to indicate success. This seems harmless on Unix.
* Clean up some docstrings. Some docstrings didn't show their returnGuido van Rossum2002-08-081-10/+11
| | | | | | value; others were inconsistent in what to name the argument or return value; a few module-global functions had "socket." in front of their name, against convention.
* internal_connect(): Windows. When sock_timeout > 0 and connect() yieldsTim Peters2002-08-061-6/+14
| | | | | | | WSAEWOULDBLOCK, the second connect() attempt appears to yield WSAEISCONN on Win98 but WSAEINVAL on Win2K. So accept either as meaning "yawn, fine". This allows test_socket to succeed on my Win2K box (which it already did on my Win98SE box).
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Pass length of result structure into setipaddr. Fixes bug #565747.Martin v. Löwis2002-07-281-8/+12
| | | | Committed to 2.2 branch.
* Put checks for error returns in the right place.Jeremy Hylton2002-07-251-2/+8
|
* Extended socket.htonl and ntohl to accept longs.Jeremy Hylton2002-07-251-15/+53
| | | | | | | Fixes SF bug #568322. The code should raise an OverflowError if the long is > 32 bits, even on platforms where sizeof(long) > 4.
* Replace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." linkMark Hammond2002-07-231-1/+1
| | | | | command line for Windows builds. This should allow MSVC to import and build the Python MSVC6 project files without error.
* Bail out early from internal_select() when socket file descriptorGuido van Rossum2002-07-191-0/+5
| | | | closed. Prevents core dump.
* A Python float is a C double; redeclare defaulttimeout as such; stopsTim Peters2002-07-181-1/+1
| | | | compiler wngs on Windows.
* Silence warning about getdefaulttimeout in PyMethodDef.Guido van Rossum2002-07-181-1/+1
|
* Add default timeout functionality. This adds setdefaulttimeout() andGuido van Rossum2002-07-181-1/+65
| | | | | getdefaulttimeout() functions to the socket and _socket modules, and appropriate tests.
* staticforward bites the dust.Jeremy Hylton2002-07-171-1/+1
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* Mac OS X Jaguar (developer preview) seems to have a working getaddrinfo().Jack Jansen2002-07-021-0/+5
|
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-82/+82
|
* Fix non-blocking connect() for Windows. Refactored the codeGuido van Rossum2002-06-131-27/+40
| | | | | | | | | | | that retries the connect() call in timeout mode so it can be shared between connect() and connect_ex(), and needs only a single #ifdef. The test for this was doing funky stuff I don't approve of, so I removed it in favor of a simpler test. This allowed me to implement a simpler, "purer" form of the timeout retry code. Hopefully that's enough (if you want to be fancy, use non-blocking mode and decode the errors yourself, like before).
* Major overhaul of timeout sockets:Guido van Rossum2002-06-131-219/+58
| | | | | | | | | | | | | | | | | | | | - setblocking(0) and settimeout(0) are now equivalent, and ditto for setblocking(1) and settimeout(None). - Don't raise an exception from internal_select(); let the final call report the error (this means you will get an EAGAIN error instead of an ETIMEDOUT error -- I don't care). - Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets, so other theads can run (this was a bug in the original code). - Redid the retry logic in connect() and connect_ex() to avoid masking errors. This probably doesn't work for Windows yet; I'll fix that next. It may also fail on other platforms, depending on what retrying a connect does; I need help with this. - Get rid of the retry logic in accept(). I don't think it was needed at all. But I may be wrong.
* work around name clash with OS/2 TCPIP routine sock_init()Andrew MacIntyre2002-06-131-2/+2
|
* Move the conex_finally label up, so that the errno value is alwaysGuido van Rossum2002-06-071-1/+1
| | | | returned.