diff options
author | Yves Orton <demerphq@gmail.com> | 2007-06-20 17:22:31 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-20 13:30:14 +0000 |
commit | 69a143a617ef4a2e1a3b3a29a66e4b9c956cf3ca (patch) | |
tree | 658cc8967db4c38fb4a33c9884c0db2d676df0bf /win32/win32sck.c | |
parent | e17472c5b224069d88d2904265c410fd8ab21037 (diff) | |
download | perl-69a143a617ef4a2e1a3b3a29a66e4b9c956cf3ca.tar.gz |
Re: Net::SMTP can't send large messages with bleadperl
Message-ID: <9b18b3110706200622o344c417apbd50468c6e5eb533@mail.gmail.com>
p4raw-id: //depot/perl@31426
Diffstat (limited to 'win32/win32sck.c')
-rw-r--r-- | win32/win32sck.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/win32/win32sck.c b/win32/win32sck.c index 2795104b34..8656c0bd67 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -666,15 +666,19 @@ int win32_ioctl(int i, unsigned int u, char *data) { dTHX; - u_long argp = (u_long)data; + u_long u_long_arg; int retval; - + if (!wsock_started) { Perl_croak_nocontext("ioctl implemented only on sockets"); /* NOTREACHED */ } - retval = ioctlsocket(TO_SOCKET(i), (long)u, &argp); + /* mauke says using memcpy avoids alignment issues */ + memcpy(&u_long_arg, data, sizeof u_long_arg); + retval = ioctlsocket(TO_SOCKET(i), (long)u, &u_long_arg); + memcpy(data, &u_long_arg, sizeof u_long_arg); + if (retval == SOCKET_ERROR) { if (WSAGetLastError() == WSAENOTSOCK) { Perl_croak_nocontext("ioctl implemented only on sockets"); |