diff lib/sshv2.c @ 41:4bcfaf6307b5

2002-10-29 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h lib/options.h src/gtk/menu-items.c src/gtk/view_dialog.c - removed tmp_directory variable. Instead use g_get_tmp_dir () * lib/gftp.h (struct gftp_request) - added int cancel : 1 * lib/misc.c lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/ssh.c lib/sshv2.c - check for interrupted signal calls * lib/protocols.c - added gftp_fgets() and gftp_fwrite() functions * src/gtk/delete_dialog.c src/gtk/misc-gtk.c src/gtk/transfer.c - use g_main_context_iteration in GTK+ 2.0 port * src/gtk/misc-gtk.c - use g_object_unref instead of gdk_drawable_unref in GTK+ 2.0 port
author masneyb
date Wed, 30 Oct 2002 02:53:21 +0000
parents 66c064fd05bc
children e5f6054590b5
line wrap: on
line diff
--- a/lib/sshv2.c	Fri Oct 18 02:53:52 2002 +0000
+++ b/lib/sshv2.c	Wed Oct 30 02:53:21 2002 +0000
@@ -499,7 +499,6 @@
                     gint32 len)
 {
   char buf[34000];
-  ssize_t wrote;
   gint32 clen;
 
   if (len > 33995)
@@ -525,25 +524,9 @@
 
   sshv2_log_command (request, gftp_logging_send, type, buf + 5, len);
 
-  wrote = fwrite (buf, len + 5, 1, request->sockfd_write);
-  if (ferror (request->sockfd_write))
-    {
-      request->logging_function (gftp_logging_error, request->user_data,
-                               _("Error: Could not write to socket: %s\n"),
-                               g_strerror (errno));
-      gftp_disconnect (request);
-      return (-1);
-    }
+  if (gftp_fwrite (request, buf, len + 5, request->sockfd_write) < 0)
+    return (-2);
 
-  fflush (request->sockfd_write);
-  if (ferror (request->sockfd_write))
-    {
-      request->logging_function (gftp_logging_error, request->user_data,
-                                 _("Error: Could not write to socket: %s\n"),
-                                 g_strerror (errno));
-      gftp_disconnect (request);
-      return (-1);
-    }
   return 0;
 }