[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kioslave/nfs
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2004-01-05 21:10:38
Message-ID: 20040105211038.B54E393EA () office ! kde ! org
[Download RAW message or body]

CVS commit by neundorf: 

-commit the patch from Martin Koller <m.koller@surfeu.at>
which fixes one crash and a "doesn't work at all for me" bug

Alex


  M +20 -6     kio_nfs.cpp   1.29


--- kdebase/kioslave/nfs/kio_nfs.cpp  #1.28:1.29
@@ -341,5 +341,10 @@ NFSFileHandle NFSProtocol::getFileHandle
 void NFSProtocol::openConnection()
 {
-   kdDebug(7121)<<"NFS::openConnection"<<endl;
+   kdDebug(7121)<<"NFS::openConnection for -" << m_currentHost.latin1() << "-" << endl;
+   if (m_currentHost.isEmpty())
+   {
+      error(ERR_UNKNOWN_HOST,"");
+      return;
+   }
    struct sockaddr_in server_addr;
    if (m_currentHost[0] >= '0' && m_currentHost[0] <= '9')
@@ -445,9 +450,18 @@ void NFSProtocol::openConnection()
    m_sock = RPC_ANYSOCK;
    m_client = clnttcp_create(&server_addr,NFSPROG,NFSVERS,&m_sock,0,0);
-   if (m_client == NULL)
+   if (m_client == 0)
    {
-      error( ERR_COULD_NOT_CONNECT, m_currentHost.latin1());
+      server_addr.sin_port = 0;
+      m_sock = RPC_ANYSOCK;
+      pertry_timeout.tv_sec = 3;
+      pertry_timeout.tv_usec = 0;
+      m_client = clntudp_create(&server_addr,NFSPROG, NFSVERS, pertry_timeout, &m_sock);
+      if (m_client==0)
+      {
+         clnt_pcreateerror(const_cast<char *>("NFS clntudp_create"));
+         error(ERR_COULD_NOT_CONNECT, m_currentHost.latin1());
       return;
-   };
+      }
+   }
    m_client->cl_auth = authunix_create(hostName.data(),geteuid(),getegid(),0,0);
    connected();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic