OSDN Git Service

Fix bugs of uploading files with unique names.
[ffftp/ffftp.git] / getput.c
index f727637..f89b2c0 100644 (file)
--- a/getput.c
+++ b/getput.c
@@ -2684,6 +2684,10 @@ static int UpLoadNonPassive(TRANSPACKET *Pkt)
                iRetCode = command(Pkt->ctrl_skt, Reply, &Canceled[Pkt->ThreadCount], "%s", Buf);\r
                if((iRetCode/100) == FTP_PRELIM)\r
                {\r
                iRetCode = command(Pkt->ctrl_skt, Reply, &Canceled[Pkt->ThreadCount], "%s", Buf);\r
                if((iRetCode/100) == FTP_PRELIM)\r
                {\r
+                       // STOUの応答を処理\r
+                       // 応答の形式に規格が無くファイル名を取得できないため属性変更を無効化\r
+                       if(Pkt->Mode == EXIST_UNIQUE)\r
+                               Pkt->Attr = -1;\r
                        // 同時接続対応\r
 //                     if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
                        if(SocksGet2ndBindReply(listen_socket, &data_socket, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
                        // 同時接続対応\r
 //                     if(SocksGet2ndBindReply(listen_socket, &data_socket) == FFFTP_FAIL)\r
                        if(SocksGet2ndBindReply(listen_socket, &data_socket, &Canceled[Pkt->ThreadCount]) == FFFTP_FAIL)\r
@@ -2840,6 +2844,10 @@ static int UpLoadPassive(TRANSPACKET *Pkt)
                                iRetCode = command(Pkt->ctrl_skt, Reply, &Canceled[Pkt->ThreadCount], "%s", Buf);\r
                                if(iRetCode/100 == FTP_PRELIM)\r
                                {\r
                                iRetCode = command(Pkt->ctrl_skt, Reply, &Canceled[Pkt->ThreadCount], "%s", Buf);\r
                                if(iRetCode/100 == FTP_PRELIM)\r
                                {\r
+                                       // STOUの応答を処理\r
+                                       // 応答の形式に規格が無くファイル名を取得できないため属性変更を無効化\r
+                                       if(Pkt->Mode == EXIST_UNIQUE)\r
+                                               Pkt->Attr = -1;\r
                                        // 一部TYPE、STOR(RETR)、PORT(PASV)を並列に処理できないホストがあるため\r
                                        ReleaseMutex(hListAccMutex);\r
                                        // FTPS対応\r
                                        // 一部TYPE、STOR(RETR)、PORT(PASV)を並列に処理できないホストがあるため\r
                                        ReleaseMutex(hListAccMutex);\r
                                        // FTPS対応\r