com php-src: add a primitive debug facility to sendmail: win32/sendmail.c

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    163bb87897c82eb7067e2a2e89818293a455e7a3
Author:    Anatol Belski <[email protected]>         Tue, 31 Jan 2017 18:25:36 +0100
Parents:   5b5130c4ff084985c4ffd8046ec7ff87fc36c975
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=163bb87897c82eb7067e2a2e89818293a455e7a3

Log:
add a primitive debug facility to sendmail

Changed paths:
  M  win32/sendmail.c


Diff:
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 9195f21..bdeff31 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -49,6 +49,8 @@
 #include "ext/standard/php_string.h"
 #include "ext/date/php_date.h"
 
+#define SENDMAIL_DEBUG 0
+
 /*enum
    {
    DO_CONNECT = WM_USER +1
@@ -780,6 +782,10 @@ static int MailConnect()
 #endif
 	SOCKADDR_IN sock_in;
 
+#if SENDMAIL_DEBUG
+return 0;
+#endif
+
 	/* Create Socket */
 	if ((PW32G(mail_socket) = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
 		return (FAILED_TO_OBTAIN_SOCKET_HANDLE);
@@ -866,6 +872,12 @@ static int Post(LPCSTR msg)
 	int slen;
 	int index = 0;
 
+#if SENDMAIL_DEBUG
+	if (msg)
+		printf("POST: '%s'\n", msg);
+	return (SUCCESS);
+#endif
+
 	while (len > 0) {
 		if ((slen = send(PW32G(mail_socket), msg + index, len, 0)) < 1)
 			return (FAILED_TO_SEND);
@@ -894,6 +906,10 @@ static int Ack(char **server_response)
 	int Index = 0;
 	int Received = 0;
 
+#if SENDMAIL_DEBUG
+	return (SUCCESS);
+#endif
+
 again:
 
 	if ((rlen = recv(PW32G(mail_socket), buf + Index, ((MAIL_BUFFER_SIZE) - 1) - Received, 0)) < 1) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.