summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
AgeCommit message (Collapse)AuthorLines
2001-08-29SF bug [#456252] Python should never stomp on [u]intptr_t.Tim Peters-1/+1
pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly.
2001-08-20SSL_dealloc(): Apply the change suggested in SF bug #425370 whichBarry Warsaw-1/+1
changes the order of the free calls to be the reverse of the alloc calls. Closes that bug.
2001-08-20It will always be a string, because it is created just before this call.Jeremy Hylton-1/+1
2001-08-15Fix portability problems with glibc 2.0, as reported in #449157.Martin v. Löwis-0/+4
2001-08-12Bump size of sprintf buffer. Suggested by Alex Coventry.Martin v. Löwis-1/+1
2001-08-10Autotest for netpacket/packet.h, as it is not available on all Linux versions.Martin v. Löwis-6/+6
Depend AF_PACKET on HAVE_NETPACKET_PACKET_H. Fixes #449157
2001-08-04Add more constants. Contributed by itojun.Martin v. Löwis-1/+73
2001-08-04Auto-detect hstrerror. Raise socket.herror in PyH_Error. Register the threeMartin v. Löwis-2/+4
exception classes in the module dictionary.
2001-08-03Do not use the system getaddrinfo on Mac OS X. Fixes bug #445928.Martin v. Löwis-6/+16
Since getnameinfo is not implemented, remove __APPLE__ check here.
2001-07-31Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 andMarc-André Lemburg-10/+2
add another use case to the socketmodule.
2001-07-30Temporarily work around bug #445928: Force usage of getaddrinfo emulationMartin v. Löwis-2/+6
code on Darwin, since the C library version of that seems to be broken.
2001-07-24Use HAVE_SNPRINTF, not HAVE_SPRINTF, for checking the availability ofThomas Wouters-1/+1
snprintf.
2001-07-24Autocheck for snprintf, and use sprintf if it is not available.Martin v. Löwis-3/+8
Remove declaration of h_errno, since it is supposedly declared in netdb.h. Changes proposed by itojun.
2001-07-23Before declaring h_errno, do not check for Win32 only. Instead, do checkMartin v. Löwis-1/+1
whether h_errno is a macro.
2001-07-23Instead of accessing ss_family, cast sockaddr_storage to sockaddr and access ↵Martin v. Löwis-1/+5
sa_family.
2001-07-21Patch #401196: IPv6 extensions to the socket module.Martin v. Löwis-103/+546
New functions getnameinfo, getaddrinfo. New exceptions socket.gaierror, socket.herror. Various new constants, in particular AF_INET6 and error codes and parameters for getaddrinfo. AF_INET6 support in setipaddr, makesockaddr, getsockaddr, getsockaddrlen, gethost_common, PySocket_gethostbyaddr.
2001-07-21Silence warnings in MSVC++: hide unused variables, add constness back toMartin v. Löwis-5/+5
inet_pton/ntop, convert htons argument to u_short.
2001-07-19Clean up some warnings from the SGI compiler.Fred Drake-3/+3
This is part of SF patch #434992.
2001-07-19Port getaddrinfo to MSVC++.Martin v. Löwis-12/+0
2001-06-25Remove const-ness in inet_pton declaration.Martin v. Löwis-1/+1
2001-06-24Fix typos in inet_pton/inet_ntop.Martin v. Löwis-2/+3
2001-06-24Provide a definition for offsetof.Martin v. Löwis-0/+8
2001-06-24Emulate inet_{pton,ntop} on systems that don't provide it.Martin v. Löwis-0/+41
2001-06-24Pure brute-force hackery to allow Python to build on Windows again,Tim Peters-0/+12
because I need to make progress and don't have time now to think about whatever it is the new code is trying to accomplish.
2001-06-23Patch #401196: Configuration machinery for IPv6.Martin v. Löwis-0/+10
Contributed by Jun-ichiro "itojun" Hagino. get{addr,name}info emulation code taken from WIDE.
2001-05-11Fix a minor style consistency issue.Fred Drake-3/+3
When getting a string buffer for a string we just created, use PyString_AS_STRING() instead of PyString_AsString() to avoid the call overhead and extra type check.
2001-05-09Three uses of makesockaddr() used sockaddr buffers that had not be cleared;Fred Drake-1/+4
this could cause invalid paths to be returned for AF_UNIX sockets on some platforms (including FreeBSD 4.2-RELEASE), appearantly because there is no assurance that the address will be nul-terminated when filled in by the kernel. PySocketSock_recvfrom(): Use PyString_AS_STRING() to get the data pointer of a string we create ourselves; there is no need for the extra type check from PyString_AsString(). This closes SF bug #416573.
2001-04-16Reverting Moshe's EGD patch *and* Martin's patch to make it work withGuido van Rossum-34/+0
OpenSSL versions beore 0.9.5. This just is too experimental to be worth it, especially since the user would have to do some severe hacking of the Modules/Setup file to even enable the EGD code, and without the EGD code it would always spit out a warning on some systems -- even when socket.ssl() is not used. Fixing that properly is not my job; the EGD patch is clearly not so important that it should hold up the 2.1 release.
2001-04-13I am TENTATIVELY checking in Martin von Loewis's patch for the SSLGuido van Rossum-0/+7
problem reported by Neil Schemenauer on python-dev on 4/12/01, wth subject "Problem with SSL and socketmodule on Debian Potato?". It's tentative because Moshe objected, but Martin rebutted, and Moshe seems unavailable for comments. (Note that with OpenSSL 0.9.6a, I get a lot of compilation warnings for socketmodule.c -- I'm assuming I can safely ignore these until 2.1 is released.)
2001-03-18Committing patch 405101Moshe Zadka-0/+27
2001-03-02RISCOS changes by dschwertberger.Guido van Rossum-104/+175
2001-02-07Remove the optional integer argument to SSL_write; now it will always sendAndrew M. Kuchling-5/+2
the entire string passed to it
2001-02-06Patch #103636: Allow writing strings containing null bytes to an SSL socketAndrew M. Kuchling-1/+1
2001-02-02fix a couple last-minute bugs in the raw socket supportJeremy Hylton-24/+24
2001-02-02SF patch 101137 from Grant EdwardsJeremy Hylton-3/+93
Adds support for raw packets (AF_PACKET) under Linux. I haven't tested this code thoroughly; it compiles and the basic calls all work without crashing. Not sure what to actually do with raw sockets though. Not sure what other platforms this might be useful for.
2001-02-01An ssl-wrapped socket now returns '' on EOF, just like a regularJeremy Hylton-7/+4
socket -- as suggested by Clarence Gardner. Fix httplib to comply with the new ssl-socket interface.
2001-01-22SF Patch #103185, by jlt63: Some more standard modules cleanup for CygwinGuido van Rossum-1/+4
2001-01-18Use openssl/*.h to include the OpenSSL header filesAndrew M. Kuchling-6/+6
2000-12-18Adapted from a patch by Barry Scott, SF patch #102875 and SF bugGuido van Rossum-3/+4
#125981: closing sockets was not thread-safe.
2000-12-01Patch by Michael Hudson to clarify the error message fromGuido van Rossum-1/+7
getsockaddrarg when the address is not a tuple.
2000-10-06Norman Vine <nhv@users.sourceforge.net>:Fred Drake-1/+1
tcp.h is not available on CygWin, so do not try to include it there. This closes SourceForge patch #101802.
2000-08-16Remove a lot of the confusing conditional compilation from the beginningFred Drake-47/+4
of the init_socket() function. This module is now *always* _socket.
2000-08-03Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.Guido van Rossum-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.
2000-08-03Use METH_VARARGS instead of numeric constant 1 in method def. tablesAndrew M. Kuchling-34/+49
2000-07-31merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp-1/+0
marked my*.h as obsolete
2000-07-25Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters-4/+4
Leave the actual #define in for API compatibility.
2000-07-24Remove unused variable and what looks like an ancient relic of an oldThomas Wouters-7/+0
version of SSLeay (now known as OpenSSL.)
2000-07-24Create a new section of pyport.h to hold all external function declarationsThomas Wouters-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.
2000-07-24Patch #100926 - Better error messages for socket exceptions on Windows. ↵Mark Hammond-2/+78
[Slight style differences from posted patch]
2000-07-22Even more ANSIfication: fix as many function pointers and declarations asThomas Wouters-1/+1
possible.