iliaa           Mon Aug 11 14:08:35 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src    NEWS 
    /php-src/win32      sendmail.c 
  Log:
  MFH: Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain
  situations). (Ilia)
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.339 php-src/NEWS:1.1247.2.340
--- php-src/NEWS:1.1247.2.339   Mon Aug 11 12:38:08 2003
+++ php-src/NEWS        Mon Aug 11 14:08:34 2003
@@ -16,6 +16,8 @@
 - Fixed bug #24142 (workaround for a gcc bug affecting round()). (Marcus, Ilia)
 - Fixed bug #24063 (serialize() missing 0 after the . on scientific notation).
   (Marcus, Ilia)
+- Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain
+  situations). (Ilia)
 - Fixed bug #21957 (serialize() mangles objects with __sleep). (Ilia)
 
 07 Aug 2003, Version 4.3.3RC3
Index: php-src/win32/sendmail.c
diff -u php-src/win32/sendmail.c:1.47.2.6 php-src/win32/sendmail.c:1.47.2.7
--- php-src/win32/sendmail.c:1.47.2.6   Mon Aug 11 12:38:08 2003
+++ php-src/win32/sendmail.c    Mon Aug 11 14:08:35 2003
@@ -17,7 +17,7 @@
  *
  */
 
-/* $Id: sendmail.c,v 1.47.2.6 2003/08/11 16:38:08 iliaa Exp $ */
+/* $Id: sendmail.c,v 1.47.2.7 2003/08/11 18:08:35 iliaa Exp $ */
 
 #include "php.h"                               /*php specific */
 #include <stdio.h>
@@ -856,11 +856,11 @@
        /* Check for newline */
        Index += rlen;
        
-       if ((buf[Received - 4] == ' ' && buf[Received - 3] == '-') ||
-           (buf[Received - 2] != '\r') || (buf[Received - 1] != '\n'))
-               /* err_msg          fprintf(stderr,"Incomplete server message. 
Awaiting CRLF\n"); */
-               goto again;                             /* Incomplete data. Line must 
be terminated by CRLF
-                                          And not contain a space followed by a '-' */
+       /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;)
+        * The response code must contain at least 5 characters ex. 220\r\n */
+       if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') {
+               goto again;
+       }
 
        if (buf[0] > '3') {
                /* If we've a valid pointer, return the SMTP server response so the 
error message contains more information */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to