diff lib/protocols.c @ 63:41b71c4e5076

2002-11-2333 Brian Masney <masneyb@gftp.org> * lib/local.c lib/rfc959.c lib/rfc2068.c lib/ssh.c lib/sshv2.c lib/gftp.h - added swap_socks function to gftp_request structure * lib/misc.c lib/protocols.c - move swap_socks() from misc.c to protocols.c (renamed to gftp_swap_socks) * src/gtk/misc-gtk.c src/gtk/transfer.c - removed fix_display() * src/gtk/delete_dialog.c src/gtk/transfer.c - changed all occurances of swap_socks() to gftp_swap_socks() * src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h - removed gftp_is_started variable
author masneyb
date Sat, 23 Nov 2002 13:45:05 +0000
parents 8a9324fb63a4
children 4b5fec7711e9
line wrap: on
line diff
--- a/lib/protocols.c	Fri Nov 22 16:04:27 2002 +0000
+++ b/lib/protocols.c	Sat Nov 23 13:45:05 2002 +0000
@@ -2154,3 +2154,24 @@
 }
 
 
+void
+gftp_swap_socks (gftp_request * dest, gftp_request * source)
+{
+  g_return_if_fail (dest != NULL);
+  g_return_if_fail (source != NULL);
+  g_return_if_fail (dest->protonum == source->protonum);
+
+  dest->sockfd = source->sockfd;
+  dest->datafd = source->datafd;
+  dest->cached = 0;
+  if (!source->always_connected)
+    {
+      source->sockfd = -1;
+      source->datafd = -1;
+      source->cached = 1;
+    }
+
+  if (dest->swap_socks)
+    dest->swap_socks (dest, source);
+}
+