210 Commits

Author SHA1 Message Date
Neal Norwitz
116a5c43a3 Fix SF # 505427, socket module fails to build on HPUX10
h_errno is not defined on HPUX with the 2.2 build env't
(ie, _XOPEN_SOURCE_EXTENDED is not defined)
2002-11-14 02:22:34 +00:00
Michael W. Hudson
dcec3a43c0 Backport Jack's fix for Jaguar. 2002-09-27 08:51:20 +00:00
Neal Norwitz
3aac4d25a2 SF bug #592645 fix memory leak in socket.getaddrinfo 2002-08-09 03:38:07 +00:00
Martin v. Löwis
1cbac94be1 Pass length of result structure into setipaddr. Fixes bug #565747. 2002-07-28 16:11:25 +00:00
Guido van Rossum
4130d6c23a Oops. That wasn't supposed to be backported. :-( 2002-06-06 20:11:15 +00:00
Guido van Rossum
93f2edba15 Backport:
The tp_new implementation should initialize the errorhandler field,
otherwise this code could segfault:

  from socket import socket
  s = socket.__new__(socket)
  s.recv(100)
2002-06-06 20:10:16 +00:00
Martin v. Löwis
b390f5f73b Patch #500311: Work around for buggy https servers. Fixes #494762. 2002-04-20 07:45:25 +00:00
Michael W. Hudson
6403be2c00 backport jackjansen's checkin of
revision 1.211 of socketmodule.c

Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(

The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.
2002-03-25 17:40:43 +00:00
Martin v. Löwis
0d21e64409 Include <unistd.h> in Python.h. Fixes #500924. 2002-01-12 11:13:24 +00:00
Michael W. Hudson
b8be8c67e6 Backport loewis' checkin of version 1.201:
Add TCP socket options from glibc 2.2.4. Fixes #495680.
2.2.1 bugfix candidate.
2001-12-28 10:12:44 +00:00
Martin v. Löwis
44ddbde3ab Remove INET6 define. Use ENABLE_IPV6 instead. 2001-12-02 10:15:37 +00:00
Tim Peters
75cdad5584 More sprintf -> PyOS_snprintf. 2001-11-28 22:07:30 +00:00
Tim Peters
885d457709 sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
2001-11-28 20:27:42 +00:00
Andrew M. Kuchling
3072ecdcd2 Fix docstring typo 2001-11-28 04:28:31 +00:00
Martin v. Löwis
fba64e1eca Test for negative buffer sizes. Fixes #482871. 2001-11-19 10:41:26 +00:00
Michael W. Hudson
03f96bd8f5 Fixes to compile cPickle.c & socketmodule.c on cygwin and possibly
other platforms that have funny ideas about whether addresses of
functions in dlls are compile-time constants.
2001-11-09 10:06:23 +00:00
Martin v. Löwis
f0b11d2893 Fix memory leaks detecting in bug report #478003. 2001-11-07 08:31:03 +00:00
Tim Peters
603c6831d0 SF patch 473749 compile under OS/2 VA C++, from Michael Muller.
Changes enabling Python to compile under OS/2 Visual Age C++.
2001-11-05 02:45:59 +00:00
Martin v. Löwis
06b1d21e7d Correct getnameinfo refcounting and tuple parsing. Fixes #476648. 2001-11-02 23:34:52 +00:00
Tim Peters
c32410ae8f PySocketSock_connect_ex(): On Windows, return the correct Windows exit
code.  The patch is from Jeremy, and allows test_asynchat to run again.
Bugfix candidate.
2001-10-30 01:26:49 +00:00
Guido van Rossum
ca6dfa55c5 Oops. In the tp_name field, the name should be "_socket.socket", not
"socket.socket" -- on Windows, "socket.socket" is the wrapper class.
Also added the module name to the SSL type (which is not a new-style
class -- I don't want to mess with it yet).
2001-10-28 12:31:33 +00:00
Guido van Rossum
384ca9c6dd Made SocketType and socket the same thing: a subclassable type whose
constructor acts just like socket() before.  All three arguments have
a sensible default now; socket() is equivalent to
socket(AF_INET, SOCK_STREAM).

One minor issue: the socket() function and the SocketType had
different doc strings; socket.__doc__ gave the signature,
SocketType.__doc__ gave the methods.  I've merged these for now, but
maybe the list of methods is no longer necessary since it can easily
be recovered through socket.__dict__.keys().  The problem with keeping
it is that the total doc string is a bit long (34 lines -- it scrolls
of a standard tty screen).

Another general issue with the socket module is that it's a big mess.
There's pages and pages of random platform #ifdefs, and the naming
conventions are totally wrong: it uses Py prefixes and CapWords for
static functions.  That's a cleanup for another day...  (Also I think
the big starting comment that summarizes the API can go -- it's a
repeat of the docstring.)
2001-10-27 22:20:47 +00:00
Guido van Rossum
9f7a539afe Add sendall() method, which loops until all data is written or an
error occurs, and doesn't return a count.  (This is my second patch
from SF patch #474307, with small change to the docstring for send().)

2.1.2 "bugfix" candidate.
2001-10-26 03:25:00 +00:00
Martin v. Löwis
7c4b5faa93 After discussion with itojun, it was clarified that Tru64 is in error,
and that the work-around should be restricted to that system.
2001-10-25 09:04:03 +00:00
Guido van Rossum
e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00