From: donghee yang Date: Mon, 27 Aug 2012 07:29:17 +0000 (+0900) Subject: [Title] Fixed a bug that file transfer failed X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54a4076b3dddead704856a60133fc5df6adc78eb;p=sdk%2Ftools%2Fsdk-build.git [Title] Fixed a bug that file transfer failed --- diff --git a/src/build_server/BuildComm.rb b/src/build_server/BuildComm.rb index f4025fd..5b0b0d4 100644 --- a/src/build_server/BuildComm.rb +++ b/src/build_server/BuildComm.rb @@ -155,7 +155,7 @@ class BuildCommServer # upload to ftp server ftp_filepath = nil - ATTEMPTS.each do |attempt| + for attempt in ATTEMPTS ftp_filepath = FileTransfer.putfile(ip, port, username, passwd, src_file, @log) if !ftp_filepath.nil? then break; else @log.info "Server is the #{attempt} upload attempt fails" end @@ -163,7 +163,9 @@ class BuildCommServer if ftp_filepath.nil? then req.puts "ERROR" return false - else @log.info "Server is the #{attempt} successful attempt to upload file: [#{File.basename(src_file)}]" end + else + @log.info "Server is the #{attempt} successful attempt to upload file: [#{File.basename(src_file)}]" + end req.puts "UPLOADED,#{ftp_filepath}" elsif cmd == "SUCC" then @log.info "Client downloaded file successfully" @@ -516,10 +518,12 @@ class BuildCommClient ftp_filepath = tok[1].strip @log.info "Server uploaded file sucessfully" dst_filepath = nil - ATTEMPTS.each do |attempt| + for attempt in ATTEMPTS dst_filepath = FileTransfer.getfile(ip, port, username, passwd, ftp_filepath, dst_file, @log) if not dst_filepath.nil? then break - else "Client is the #{attempt} download attempt fails" end + else + @log.warn "Client is the #{attempt} download attempt fails" + end end if dst_filepath.nil? then send "ERROR"