summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove a lot of the confusing conditional compilation from the beginningFred Drake2000-08-161-47/+4
| | | | of the init_socket() function. This module is now *always* _socket.
* Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.Guido van Rossum2000-08-031-10/+0
| | | | | | This doesn't change the copyright status for these files -- just the markings! Doing it on the main branch for these three files for which the HEAD revision was pushed back into 1.6.
* Use METH_VARARGS instead of numeric constant 1 in method def. tablesAndrew M. Kuchling2000-08-031-35/+50
|
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-1/+0
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-251-4/+4
| | | | Leave the actual #define in for API compatibility.
* Remove unused variable and what looks like an ancient relic of an oldThomas Wouters2000-07-241-7/+0
| | | | version of SSLeay (now known as OpenSSL.)
* Create a new section of pyport.h to hold all external function declarationsThomas Wouters2000-07-241-11/+2
| | | | | | | | | | | | | | for systems that are missing those declarations from system include files. Start by moving a pointy-haired ones from their previous locations to the new section. (The gethostname() one, for instance, breaks on several systems, because some define it as (char *, size_t) and some as (char *, int).) I purposely decided not to include the summary of used #defines like Tim did in the first section of pyport.h. In my opinion, the number of #defines likedly to be used by this section would make such an overview unwieldy. I would suggest documenting the non-obvious ones, though.
* Patch #100926 - Better error messages for socket exceptions on Windows. ↵Mark Hammond2000-07-241-2/+78
| | | | [Slight style differences from posted patch]
* Even more ANSIfication: fix as many function pointers and declarations asThomas Wouters2000-07-221-1/+1
| | | | possible.
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-8/+6
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* Errare humanum est.Peter Schneider-Kamp2000-07-111-1/+1
| | | | Changed parameter in getsockaddrlen from unsigned to socklen_t.
* fixed a warning in getsockaddrlenPeter Schneider-Kamp2000-07-111-1/+1
|
* - ANSI-ificationFredrik Lundh2000-07-091-94/+47
| | | | (patch #100770 by Peter Schneider-Kamp)
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-1/+1
|
* Removed a prototype which is not used in socketmodule.cMarc-André Lemburg2000-07-071-1/+0
| | | | Patch by T. Wouters.
* Restore strict checking of socket address values; addresses passed toFred Drake2000-07-011-15/+21
| | | | | | | the bind(), connect(), and connect_ex() methods must be a single parameter. Originally part of 1.98, reverted in 1.100.
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-13/+46
| | | | | | | | | | | | | | | | | | This patch fixes possible overflows in the socket module for 64-bit platforms (mainly Win64). The changes are: - abstract the socket type to SOCKET_T (this is SOCKET on Windows, int on Un*x), this is necessary because sizeof(SOCKET) > sizeof(int) on Win64 - use INVALID_SOCKET on Win32/64 for an error return value for accept() - ensure no overflow of the socket variable for: (1) a PyObject return value (use PyLong_FromLongLong if necessary); and (2) printf formatting in repr(). Closes SourceForge patch #100516.
* Donn Cave <donn@oz.net>:Fred Drake2000-05-161-0/+2
| | | | BeOS (up to 5.0) lacks <netinet/tcp.h>.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-9/+9
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Fix typo in last patch -- the symbol's name is MSG_DONWAIT, notGuido van Rossum2000-04-251-1/+1
| | | | MSG_DONTWAIT. Reported by Fredrik Lundh.
* Patch by Charles G Waldman:Guido van Rossum2000-04-251-1/+4
| | | | | 1) Adds MSG_DONTWAIT if defined (I needed this) 2) Spells "coreectly" correctly ;-)
* Jack Jansen: The GUSI 2.0 I/O library used on the Mac uses theGuido van Rossum2000-04-241-9/+15
| | | | | | | | | | socklen_t (unsigned int) for most size parameters. Apparently this is part of the UNIX 98 standard. [GvR: the changes to configure.in etc. that I just checked in make sure that socklen_t is defined everywhere, so I deleted the little part of Jack's mod to define socklen_t if not in GUSI2. I suppose I will have to add it to the Windows config.h in a minute.]
* Use an explicit macro SOCKETCLOSE which expands to closesocket (onGuido van Rossum2000-04-211-10/+14
| | | | | | | | | Windows), soclose (on OS2), or to close (everywhere else). Hopefully this fixes a new compilation error that I suddenly get on Windows because the macro definition for close -> closesocket apparently was done before including io.h, which contains a prototype for close. (No idea why this wasn't an error before.)
* In dealloc(), only close the socket if fd != -1.Guido van Rossum2000-04-101-1/+2
|
* Add warning that multi-arg connect() etc. are deprecated.Guido van Rossum2000-04-041-1/+1
|
* Put back multi-arg capability on connect/connect_ex/bind, forGuido van Rossum2000-04-041-21/+15
| | | | backwards compatibility, and to avoid a revolution.
* Add '#include <netinet/tcp.h>'Andrew M. Kuchling2000-03-311-0/+1
| | | | | | "man tcp" on Solaris says that TCP_NODELAY is defined in netinet/tcp.h, and the Open Groups Unix98 spec agrees (http://www.opengroup.org/onlinepubs/009619199/ninettcp.htm).
* Fix all routines to use PyArg_ParseTuple(), and add ":name" to theGuido van Rossum2000-03-241-58/+71
| | | | | | | | argument format strings. THIS WILL PROBABLY BREAK LOTS OF CODE!!! Also fixed a bogus string in an error message in getsockaddrlen().
* Fixed inet_ntoa() docstring.Fred Drake2000-03-071-1/+1
|
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-9/+9
| | | | PyArg_ParseTuple() format string arguments as possible.
* OpenSSL support. This is based on patches for a version of SSLeay byGuido van Rossum1999-12-071-1/+290
| | | | | | Brian E Gallew, which were improved and adapted to OpenSSL 0.9.4 by Laszlo Kovacs of HP. Both have kindly given permission to include the patches in the Python distribution. Final formatting by GvR.
* Bugfix by Jack Jansen for Macintosh (for the inet_ntoa/aton changes):Guido van Rossum1999-11-041-1/+6
| | | | | <arpa/inet.h> doesn't exist and isn't needed; and inet_addr() returns a structure containing a long rather than a long.
* (1) On Linux, we really need to trust the configure script to selectGuido van Rossum1999-09-151-2/+13
| | | | | | | | | the right variant of gethostbyname_r for us, since not all Linuxes are equal in this respect. Reported by Laurent Pointal. (2) On BeOS, Chris Herborth reports that instead of arpa/inet.h you must include net/netdb.h to get the inet_ntoa() and inet_addr() prototypes.
* It appears that inet_aton() doesn't really exist except in libresolv;Guido van Rossum1999-09-091-20/+3
| | | | | the proper function to call is inet_addr(). Since we already had code to do that (for MS-Windows), this simplifies things a lot!
* Port inet_ntoa and inet_aton to Windows:Guido van Rossum1999-08-201-2/+23
| | | | | | - fix unescaped newline in string literal - removed unused err variable - Windows doesn't have inet_aton; use inet_addr instead
* Patch by Ben Gertzfield to add inet_aton() and inet_ntoa() calls.Guido van Rossum1999-08-201-0/+72
|
* Patch by Marc-Andre Lemburg to add a bunch more symbols.Guido van Rossum1999-08-091-2/+86
|
* Put back __osf__ support for gethostbyname_r(); the real bug was thatGuido van Rossum1999-04-131-1/+5
| | | | | | it was being used even without threads. This of course might be an all-platform problem so now we only use the _r variant when we are using threads.
* 3-arg gethostbyname_r doesn't really work on OSF/1.Guido van Rossum1999-04-101-1/+1
|
* Implement two suggestions by Jonathan Giddy: (1) in AIX, clear theGuido van Rossum1999-03-241-0/+19
| | | | | | | | | | | | data struct before calling gethostby{name,addr}_r(); (2) ignore the 3/5/6 args determinations made by the configure script and switch on platform identifiers instead: AIX, OSF have 3 args Sun, SGI have 5 args Linux has 6 args On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
* Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.Guido van Rossum1999-03-241-14/+32
|
* Clean up pass for the previous patches.Guido van Rossum1999-03-221-23/+35
| | | | | | | | | | | | | | | | | | - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and glibc2. - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R -- don't know what code should be used. - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used. - Modify the gethostbyaddr() code to also hold on to the lock until after it is safe to release, overlapping with the Python lock. (Note: I think that it could in theory be possible that Python code executed while gethostbyname_lock is held could attempt to reacquire the lock -- e.g. in a signal handler or destructor. I will simply say "don't do that then.")
* Jonathan Giddy writes:Guido van Rossum1999-03-221-8/+15
| | | | | | | | Here's a patch to fix the race condition, which wasn't fixed by Rob's patch. It holds the gethostbyname lock until the results are copied out, which means that this lock and the Python global lock are held at the same time. This shouldn't be a problem as long as the gethostbyname lock is always acquired when the global lock is not held.
* Patch by Rob Riggs for Linux -- glibc2 has a different argumentGuido van Rossum1999-03-151-0/+24
| | | | converntion for gethostbyname_r() etc. than Solaris!
* Thanks to Chris Herborth, the thread primitives now have proper Py*Guido van Rossum1998-12-211-8/+8
| | | | | names in the source code (they already had those for the linker, through some smart macros; but the source still had the old, un-Py names).
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Use the t# format where appropriate. Greg Stein.Guido van Rossum1998-10-081-1/+1
|
* Renamed thread.h to pythread.h.Guido van Rossum1998-10-011-1/+1
|