[syslinux:lwip] pxe, ftp: correct the handling of continuation lines

syslinux-bot for H. Peter Anvin hpa at zytor.com
Tue May 3 23:57:40 PDT 2011


Commit-ID:  b61066d7577ddbe1283a973df668bb124d3ddb23
Gitweb:     http://syslinux.zytor.com/commit/b61066d7577ddbe1283a973df668bb124d3ddb23
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Tue, 3 May 2011 23:54:58 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 3 May 2011 23:54:58 -0700

pxe, ftp: correct the handling of continuation lines

Correct the handling of FTP messages with continuation lines.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/fs/pxe/ftp.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/core/fs/pxe/ftp.c b/core/fs/pxe/ftp.c
index 10a9f5c..097536d 100644
--- a/core/fs/pxe/ftp.c
+++ b/core/fs/pxe/ftp.c
@@ -80,19 +80,16 @@ static int ftp_cmd_response(struct inode *inode, const char *cmd,
     done = false;
 
     while ((c = pxe_getc(inode)) >= 0) {
-	//printf("%c", c);
-
 	if (c == '\n') {
-	    pos = 0;
 	    if (done) {
 		if (pn) {
 		    pn += ps;
 		    if (pn_ptr)
 			*pn_ptr = pn;
 		}
-		//printf("FTP response: %u\n", code);
 		return code;
 	    }
+	    pos = code = 0;
 	    first_line = false;
 	    continue;
 	}
@@ -248,9 +245,6 @@ void ftp_open(struct url_info *url, int flags, struct inode *inode,
     }
 
     resp = ftp_cmd_response(socket->ctl, "PASV", NULL, pasv_data, &pasv_bytes);
-    //printf("%u PASV %u bytes %u,%u,%u,%u,%u,%u\n",
-    //resp, pasv_bytes, pasv_data[0], pasv_data[1], pasv_data[2],
-    //pasv_data[3], pasv_data[4], pasv_data[5]);
     if (resp != 227 || pasv_bytes != 6)
 	goto err_disconnect;
 



More information about the Syslinux-commits mailing list