Skip to content

Commit d5f0071

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: add a primitive debug facility to sendmail
2 parents 2c0c704 + 163bb87 commit d5f0071

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
@@ -49,6 +49,8 @@
4949
#include "ext/standard/php_string.h"
5050
#include "ext/date/php_date.h"
5151

52+
#define SENDMAIL_DEBUG 0
53+
5254
/*enum
5355
{
5456
DO_CONNECT = WM_USER +1
@@ -780,6 +782,10 @@ static int MailConnect()
780782
#endif
781783
SOCKADDR_IN sock_in;
782784

785+
#if SENDMAIL_DEBUG
786+
return 0;
787+
#endif
788+
783789
/* Create Socket */
784790
if ((PW32G(mail_socket) = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
785791
return (FAILED_TO_OBTAIN_SOCKET_HANDLE);
@@ -866,6 +872,12 @@ static int Post(LPCSTR msg)
866872
int slen;
867873
int index = 0;
868874

875+
#if SENDMAIL_DEBUG
876+
if (msg)
877+
printf("POST: '%s'\n", msg);
878+
return (SUCCESS);
879+
#endif
880+
869881
while (len > 0) {
870882
if ((slen = send(PW32G(mail_socket), msg + index, len, 0)) < 1)
871883
return (FAILED_TO_SEND);
@@ -894,6 +906,10 @@ static int Ack(char **server_response)
894906
int Index = 0;
895907
int Received = 0;
896908

909+
#if SENDMAIL_DEBUG
910+
return (SUCCESS);
911+
#endif
912+
897913
again:
898914

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

0 commit comments

Comments
 (0)