You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/09/16 08:34:07 UTC
DO NOT REPLY [Bug 45817] New: FTPClient timeout
https://issues.apache.org/bugzilla/show_bug.cgi?id=45817
Summary: FTPClient timeout
Product: Apache httpd-1.3
Version: HEAD
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Other
AssignedTo: bugs@httpd.apache.org
ReportedBy: anujasnair@gmail.com
FTPClient.connet is not returning anything. By any means can we set timeout in
the code?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45817] FTPClient timeout
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45817
rahul <ra...@sun.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from rahul <ra...@sun.com> 2008-09-16 00:15:59 PST ---
What is FtpClient.connect? is it part of apache code? It looks suspiciously
like part of a test script. Do let us know what the problem is in full detail.
(Include httpd -l and your httpd.conf also in case they are relevant. and
please do confirm the version of httpd.)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45817] FTPClient timeout
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45817
Ruediger Pluem <rp...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
--- Comment #3 from Ruediger Pluem <rp...@apache.org> 2008-09-18 23:57:13 PST ---
This is the wrong bug reporting tool. Please open a report at
https://issues.apache.org/jira/browse/NET
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 45817] FTPClient timeout
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45817
Anuja <an...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
--- Comment #2 from Anuja <an...@gmail.com> 2008-09-18 22:13:33 PST ---
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
I am using the above mentined Apache classes to connect to FTP
A thread is continuously polling(15 min) FTP for a particular file and
dwonloading if this is available in FTP
This thread was working fine until a Socket exception came. May be due to slow
network. In the next iteetarion of the thread it came uptil
ftpClient.connect(url);
after that no response from FTP.
public boolean connect(String url, String user, String password) throws
FtpException{
if(log.isDebugEnabled()){
log.debug("Inside Connect function>> ");
log.debug("url>> "+url);
log.debug("user>> "+user);
log.debug("password>> "+password);
}
boolean success = false;
try{
if(url == null || url.trim().length() == 0){
throw new FtpException(FtpException.FTP_CONNECTION_FAILED, "ftp
url not provided");
}
if(log.isDebugEnabled()){
log.debug("Just before Connect function>> ");
}
ftpClient.setDefaultTimeout(2000);
//ftpClient.setDataTimeout(1);
//ftpClient.setSoTimeout(20000);
ftpClient.connect(url);
if(log.isDebugEnabled()){
log.debug("Just before Connect function>> ");
}
success = ftpClient.login(user, password);
if(success){
if(log.isDebugEnabled()){
log.debug("Login to ftp successfull. url: " +
url + ", user : " + user + ", password : " + password);
}
}else{
throw new FtpException(FtpException.FTP_CONNECTION_FAILED,
"Could not login to ftp. url: " +
url + ", user : " + user + ", password : " + password);
}
}catch(FtpException fe){
ExploitLogger.error(MessageCodes.CD_4007,
MessageCodes.getMsg(MessageCodes.CD_4007) + "- " + fe.getMessage());
if(log.isDebugEnabled()){
log.debug("Unable to connect to ftp. url : " +
url + " >> user : " + user + " >> password : " + password,
fe);
}
throw fe;
}catch(SocketException se){
ExploitLogger.error(MessageCodes.CD_4007,
MessageCodes.getMsg(MessageCodes.CD_4007) + "- " + se.getMessage());
if(log.isDebugEnabled()){
log.debug("Unable to connect to ftp. url : " +
url + " >> user : " + user + " >> password : " + password,
se);
}
throw new FtpException(FtpException.FTP_CONNECTION_FAILED, se);
}catch(IOException ie){
ExploitLogger.error(MessageCodes.CD_4007,
MessageCodes.getMsg(MessageCodes.CD_4007) + "- " + ie.getMessage());
if(log.isDebugEnabled()){
log.debug("Unable to login to ftp. url :: " +
url + " >> user : " + user + " >> password : " + password,
ie);
}
throw new FtpException(FtpException.FTP_CONNECTION_FAILED, ie);
}catch(Exception e){
ExploitLogger.error(MessageCodes.CD_4007,
MessageCodes.getMsg(MessageCodes.CD_4007) + "- " + e.getMessage());
if(log.isDebugEnabled()){
log.debug("Unable to connect to ftp. url ::: " +
url + " >> user : " + user + " >> password : " + password,
e);
}
throw new FtpException(FtpException.FTP_CONNECTION_FAILED, e);
}
finally{
if(log.isDebugEnabled()){
log.debug("Inside Finally>> success is> "+success);
}
}
// After connection attempt, you should check the reply code to verify
// success.
if(log.isDebugEnabled()){
log.debug("Reply code for connecting to ftp >>>" +
ftpClient.getReplyCode() + " " + ftpClient.getReplyString());
}
return success;
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org