cvs: php-src /win32 sendmail.c

From: Date: Mon, 11 Aug 2003 18:03:24 +0000
Subject: cvs: php-src /win32 sendmail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-23094@lists.php.net to get a copy of this message
iliaa Mon Aug 11 14:03:24 2003 EDT Modified files: /php-src/win32 sendmail.c Log: Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain situations). Index: php-src/win32/sendmail.c diff -u php-src/win32/sendmail.c:1.56 php-src/win32/sendmail.c:1.57 --- php-src/win32/sendmail.c:1.56 Mon Aug 11 12:37:32 2003 +++ php-src/win32/sendmail.c Mon Aug 11 14:03:24 2003 @@ -17,7 +17,7 @@ * */ -/* $Id: sendmail.c,v 1.56 2003/08/11 16:37:32 iliaa Exp $ */ +/* $Id: sendmail.c,v 1.57 2003/08/11 18:03:24 iliaa Exp $ */ #include "php.h" /*php specific */ #include <stdio.h> @@ -883,11 +883,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 */

« previous php.cvs (#23094) next »