X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_ftp.c;h=b4e8d46ec2724c77da6af638777fb44f5820fc55;hb=1ea936cbf1bb3b19bd55839b904ef59ada84b8b5;hp=ead3a04ec084bf4f36245e9e2413a86cc2a3dfbb;hpb=1198c9d26848e2613d6080b4a1b3471379b699e8;p=silc.git diff --git a/lib/silcclient/client_ftp.c b/lib/silcclient/client_ftp.c index ead3a04e..b4e8d46e 100644 --- a/lib/silcclient/client_ftp.c +++ b/lib/silcclient/client_ftp.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2001 - 2007 Pekka Riikonen + Copyright (C) 2001 - 2008 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,6 @@ GNU General Public License for more details. */ -/* $Id$ */ #include "silc.h" #include "silcclient.h" @@ -108,7 +107,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 +129,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; } @@ -193,7 +192,7 @@ static void silc_client_ftp_open_handle(SilcSFTP sftp, SILC_CLIENT_MESSAGE_ERROR, "File `%s' open failed: %s", session->filepath, - strerror(errno)); + silc_errno_string(silc_errno)); if (session->monitor) (*session->monitor)(session->client, session->conn, @@ -380,6 +379,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 */ @@ -736,7 +737,8 @@ silc_client_file_send(SilcClient client, if (!session->listener) { client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR, "Cannot create listener for file transfer: " - "%s", strerror(errno)); + "%s", silc_errno_string(silc_errno)); + silc_free(session); return SILC_CLIENT_FILE_NO_MEMORY; } @@ -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; } @@ -864,7 +871,8 @@ silc_client_file_receive(SilcClient client, if (!session->listener) { client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR, "Cannot create listener for file transfer: " - "%s", strerror(errno)); + "%s", silc_errno_string(silc_errno)); + silc_free(session); return SILC_CLIENT_FILE_NO_MEMORY; }