Added SILC Thread Queue API
[runtime.git] / lib / silcclient / client_ftp.c
index ead3a04ec084bf4f36245e9e2413a86cc2a3dfbb..a38d03c009873b315aea103310d6d94e9335213b 100644 (file)
@@ -108,7 +108,7 @@ static void silc_client_ftp_data(SilcSFTP sftp,
     silc_sftp_close(sftp, session->read_handle, NULL, NULL);
     session->read_handle = NULL;
 
-    /* Close the read file descriptor */
+    /* Close the real file descriptor */
     silc_file_close(session->fd);
     return;
   }
@@ -130,7 +130,7 @@ static void silc_client_ftp_data(SilcSFTP sftp,
     silc_sftp_close(sftp, session->read_handle, NULL, NULL);
     session->read_handle = NULL;
 
-    /* Close the read file descriptor */
+    /* Close the real file descriptor */
     silc_file_close(session->fd);
     return;
   }
@@ -380,6 +380,8 @@ static void silc_client_ftp_session_free(SilcClientFtpSession session)
 {
   SILC_LOG_DEBUG(("Free session %d", session->session_id));
 
+  silc_schedule_task_del_by_context(session->client->schedule, session);
+
   silc_dlist_del(session->client->internal->ftp_sessions, session);
 
   /* Abort connecting  */
@@ -853,6 +855,11 @@ silc_client_file_receive(SilcClient client,
     /* Add the listener for the key agreement */
     SILC_LOG_DEBUG(("Creating listener for file transfer"));
     if (!params || (!params->local_ip && !params->bind_ip)) {
+      session->client->internal->ops->say(session->client, session->conn,
+                                         SILC_CLIENT_MESSAGE_ERROR,
+                                         "Cannot create listener for file "
+                                         "transfer; IP address and/or port "
+                                         "not provided");
       silc_free(session);
       return SILC_CLIENT_FILE_ERROR;
     }