150 Commits

Author SHA1 Message Date
Jeremy Hylton
13aa64bfae Backport variety of SSL fixes accumulated on the trunk. 2002-07-02 19:05:33 +00:00
Anthony Baxter
e40ae1f762 backport of 1.196: socket.recv(-1) fixup. 2001-12-23 01:44:49 +00:00
Anthony Baxter
df71fc0125 wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS.
other half of backport of guido's 1.188
2001-11-01 14:25:38 +00:00
Anthony Baxter
aadae7dae9 partial backport of guido's 1.188.
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().)

the 'partial' is because 1.188 also added a couple of Py_*_ALLOW_THREADS
wrappers around SSL_read and SSL_write, and I want to check those separately.

This is adding a new method to the socket object, which would normally
be a bad thing to do in a bugfix release - however, in this case, it
allows fixes for a nasty problem that would otherwise have a filthy
filthy fix to Get It Right. Still to-do is to patch the std library
modules to use sendall() where appropriate, rather than send().
2001-11-01 14:14:26 +00:00
Anthony Baxter
7aff5e470a backport of MvL's 1.180
Test for __sun instead of __sun__, since SUNWspro only defines the latter;
  gcc defines both.
...must get sparc box at home out of cupboard for testing this stuff...
2001-11-01 14:05:52 +00:00
Anthony Baxter
3357529c34 backport tim's 1.191:
PySocketSock_connect_ex():  On Windows, return the correct Windows exit
  code.  The patch is from Jeremy, and allows test_asynchat to run again.
2001-11-01 14:00:11 +00:00
Anthony Baxter
5d0fdbc690 backport (partially) jeremy's 1.178
Use PySocket_Err() instead of PyErr_SetFromErrno().
  The former does the right thing on Windows, the latter does not.

The 'partial' is because the code's changed quite a lot and it's not clear
that the two that are still there of the form
                return PyErr_SetFromErrno(SSLErrorObject);
can be replaced with PySocket_Err() - it looks like they need the new
PySSL_SetError, which is a tad large to be comfortable with just checking
in without reading it further.
2001-11-01 13:58:16 +00:00
Guido van Rossum
bad60d9674 Fix leak in SSLread in nonblocking mode -- from SF bug #472798.
(Not a merge from the code on the trunk -- the trunk has evolved
perhaps too much.)
2001-10-19 15:17:42 +00:00
Fred Drake
62648d1406 Three uses of makesockaddr() used sockaddr buffers that had not be cleared;
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.

This closes SF bug #416573.
2001-05-09 19:13:40 +00:00
Guido van Rossum
13324e1e1f Reverting Moshe's EGD patch *and* Martin's patch to make it work with
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-16 00:21:33 +00:00
Guido van Rossum
058dae37a6 I am TENTATIVELY checking in Martin von Loewis's patch for the SSL
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-04-13 17:54:04 +00:00
Moshe Zadka
8f4eab2345 Committing patch 405101 2001-03-18 17:11:56 +00:00
Guido van Rossum
48a680c097 RISCOS changes by dschwertberger. 2001-03-02 06:34:14 +00:00
Andrew M. Kuchling
b38175ef3d Remove the optional integer argument to SSL_write; now it will always send
the entire string passed to it
2001-02-07 20:41:17 +00:00
Andrew M. Kuchling
8820a535c1 Patch #103636: Allow writing strings containing null bytes to an SSL socket 2001-02-06 22:58:05 +00:00
Jeremy Hylton
dbfb66296c fix a couple last-minute bugs in the raw socket support 2001-02-02 19:55:17 +00:00
Jeremy Hylton
2230865043 SF patch 101137 from Grant Edwards
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-02 03:23:09 +00:00
Jeremy Hylton
42dd01add5 An ssl-wrapped socket now returns '' on EOF, just like a regular
socket -- as suggested by Clarence Gardner.

Fix httplib to comply with the new ssl-socket interface.
2001-02-01 23:35:20 +00:00
Guido van Rossum
a120ffcf12 SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin 2001-01-22 15:29:14 +00:00
Andrew M. Kuchling
697a0b0f96 Use openssl/*.h to include the OpenSSL header files 2001-01-18 17:41:41 +00:00
Guido van Rossum
20d3fc071b Adapted from a patch by Barry Scott, SF patch #102875 and SF bug
#125981: closing sockets was not thread-safe.
2000-12-18 22:23:44 +00:00
Guido van Rossum
e4dad905d4 Patch by Michael Hudson to clarify the error message from
getsockaddrarg when the address is not a tuple.
2000-12-01 13:13:11 +00:00
Fred Drake
51d9036cc8 Norman Vine <nhv@users.sourceforge.net>:
tcp.h is not available on CygWin, so do not try to include it there.

This closes SourceForge patch #101802.
2000-10-06 15:37:06 +00:00
Fred Drake
a136d4970c Remove a lot of the confusing conditional compilation from the beginning
of the init_socket() function.  This module is now *always* _socket.
2000-08-16 14:18:30 +00:00
Guido van Rossum
c4a19e7fe9 Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.
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-03 16:42:14 +00:00