cvs: /php4 fopen-wrappers.c
| From: | Thies C. Arntzen | Date: | Thu, 11 Nov 1999 13:50:13 +0000 |
| Subject: | cvs: /php4 fopen-wrappers.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6135@lists.php.net to get a copy of this message | ||
thies Thu Nov 11 08:50:13 1999 EDT
Modified files:
/php4 fopen-wrappers.c
Log:
(PHP fopen) commands send to a FTP-server need to end in "\r\n" (RFC 854)
Index: php4/fopen-wrappers.c
diff -u php4/fopen-wrappers.c:1.29 php4/fopen-wrappers.c:1.30
--- php4/fopen-wrappers.c:1.29 Sat Oct 16 12:35:18 1999
+++ php4/fopen-wrappers.c Thu Nov 11 08:49:42 1999
@@ -16,7 +16,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.29 1999/10/16 16:35:18 andrei Exp $ */
+/* $Id: fopen-wrappers.c,v 1.30 1999/11/11 13:49:42 thies Exp $ */
/* Synced with php3 revision 1.66 1999-06-18 [ssb] */
@@ -677,7 +677,7 @@
} else {
SOCK_WRITE("anonymous", *socketd);
}
- SOCK_WRITE("\n", *socketd);
+ SOCK_WRITE("\r\n", *socketd);
/* get the response */
result = _php3_getftpresult(*socketd);
@@ -697,7 +697,7 @@
SOCK_WRITE("anonymous", *socketd);
}
}
- SOCK_WRITE("\n", *socketd);
+ SOCK_WRITE("\r\n", *socketd);
/* read the response */
result = _php3_getftpresult(*socketd);
@@ -715,7 +715,7 @@
}
/* set the connection to be binary */
- SOCK_WRITE("TYPE I\n", *socketd);
+ SOCK_WRITE("TYPE I\r\n", *socketd);
result = _php3_getftpresult(*socketd);
if (result > 299 || result < 200) {
free_url(resource);
@@ -727,7 +727,7 @@
/* find out the size of the file (verifying it exists) */
SOCK_WRITE("SIZE ", *socketd);
SOCK_WRITE(resource->path, *socketd);
- SOCK_WRITE("\n", *socketd);
+ SOCK_WRITE("\r\n", *socketd);
/* read the response */
result = _php3_getftpresult(*socketd);
@@ -754,7 +754,7 @@
}
/* set up the passive connection */
- SOCK_WRITE("PASV\n", *socketd);
+ SOCK_WRITE("PASV\r\n", *socketd);
while (SOCK_FGETS(tmp_line, sizeof(tmp_line)-1, *socketd) &&
!(isdigit((int) tmp_line[0]) && isdigit((int) tmp_line[1]) &&
isdigit((int) tmp_line[2]) && tmp_line[3] == ' '));
@@ -833,7 +833,7 @@
}
/* close control connection */
- SOCK_WRITE("\nQUIT\n", *socketd);
+ SOCK_WRITE("\r\nQUIT\r\n", *socketd);
SOCK_FCLOSE(*socketd);
/* open the data channel */