Skip to content

Commit 5a9742e

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: add a primitive debug facility to sendmail
2 parents 0aa73a5 + d5f0071 commit 5a9742e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

win32/sendmail.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include "ext/standard/php_string.h"
4444
#include "ext/date/php_date.h"
4545

46+
#define SENDMAIL_DEBUG 0
47+
4648
/*enum
4749
{
4850
DO_CONNECT = WM_USER +1
@@ -770,6 +772,10 @@ static int MailConnect()
770772
#endif
771773
SOCKADDR_IN sock_in;
772774

775+
#if SENDMAIL_DEBUG
776+
return 0;
777+
#endif
778+
773779
/* Create Socket */
774780
if ((PW32G(mail_socket) = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
775781
return (FAILED_TO_OBTAIN_SOCKET_HANDLE);
@@ -856,6 +862,12 @@ static int Post(LPCSTR msg)
856862
int slen;
857863
int index = 0;
858864

865+
#if SENDMAIL_DEBUG
866+
if (msg)
867+
printf("POST: '%s'\n", msg);
868+
return (SUCCESS);
869+
#endif
870+
859871
while (len > 0) {
860872
if ((slen = send(PW32G(mail_socket), msg + index, len, 0)) < 1)
861873
return (FAILED_TO_SEND);
@@ -884,6 +896,10 @@ static int Ack(char **server_response)
884896
int Index = 0;
885897
int Received = 0;
886898

899+
#if SENDMAIL_DEBUG
900+
return (SUCCESS);
901+
#endif
902+
887903
again:
888904

889905
if ((rlen = recv(PW32G(mail_socket), buf + Index, ((MAIL_BUFFER_SIZE) - 1) - Received, 0)) < 1) {

0 commit comments

Comments
 (0)