Change 31426 by [EMAIL PROTECTED] on 2007/06/20 13:30:14

        Subject: Re: Net::SMTP can't send large messages with bleadperl
        From: demerphq <[EMAIL PROTECTED]>
        Date: Wed, 20 Jun 2007 15:22:31 +0200
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/win32/win32sck.c#47 edit

Differences ...

==== //depot/perl/win32/win32sck.c#47 (text) ====
Index: perl/win32/win32sck.c
--- perl/win32/win32sck.c#46~25101~     2005-07-08 09:35:10.000000000 -0700
+++ perl/win32/win32sck.c       2007-06-20 06:30:14.000000000 -0700
@@ -666,15 +666,19 @@
 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");
End of Patch.

Reply via email to