Exemple #1
0
        public static int DoReceive(ClientInfo cInfo, List <FileStruct> fileList, string localName)
        {
            IOStream f        = cInfo.IoStream;
            Options  options  = cInfo.Options;
            Receiver receiver = new Receiver(options);

            options.copyLinks = false;
            f.Flush();
            if (!options.deleteAfter)
            {
                if (options.recurse && options.deleteMode && localName == null && fileList.Count > 0)
                {
                    receiver.DeleteFiles(fileList);
                }
            }
            f.IOStartBufferingOut();
            Generator gen = new Generator(options);

            gen.GenerateFiles(f, fileList, localName);
            f.Flush();
            if (fileList != null && fileList.Count != 0)
            {
                receiver.ReceiveFiles(cInfo, fileList, localName);
            }
            MainClass.Report(cInfo);
            if (options.protocolVersion >= 24)
            {
                /* send a final goodbye message */
                f.writeInt(-1);
            }
            f.Flush();
            return(0);
        }
Exemple #2
0
        public static int DoReceive(ClientInfo cInfo, List<FileStruct> fileList, string localName)
        {
            IOStream f = cInfo.IoStream;
            Options options = cInfo.Options;
            Receiver receiver = new Receiver(options);

            options.copyLinks = false;
            f.Flush();
            if (!options.deleteAfter)
            {
                if (options.recurse && options.deleteMode && localName == null && fileList.Count > 0)
                {
                    receiver.DeleteFiles(fileList);
                }
            }
            f.IOStartBufferingOut();
            Generator gen = new Generator(options);
            gen.GenerateFiles(f, fileList, localName);
            f.Flush();
            if (fileList != null && fileList.Count != 0)
            {
                receiver.ReceiveFiles(cInfo, fileList, localName);
            }
            MainClass.Report(cInfo);
            if (options.protocolVersion >= 24)
            {
                /* send a final goodbye message */
                f.writeInt(-1);
            }
            f.Flush();
            return 0;
        }