pidgin: 99129722: Remove the special case of fd=0 in purpl...

andrew.victor at mxit.com andrew.victor at mxit.com
Sun Sep 25 15:40:22 EDT 2011


----------------------------------------------------------------------
Revision: 9912972220e43702dfc027a7d3b30db1697ed746
Parent:   8aee2dc6d5c2b5f92ffc4827320062298dc5c1c0
Author:   andrew.victor at mxit.com
Date:     09/25/11 15:28:12
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9912972220e43702dfc027a7d3b30db1697ed746

Changelog: 

Remove the special case of fd=0 in purple_xfer_start().
All the included protocol prpl's seem to do the right thing.
 

Changes against parent 8aee2dc6d5c2b5f92ffc4827320062298dc5c1c0

  patched  libpurple/ft.c
  patched  libpurple/ft.h

-------------- next part --------------
============================================================
--- libpurple/ft.c	478d518929bf7a380254d2916fde815b78d424c9
+++ libpurple/ft.c	568cb5f69e610604455a12b5c1f97581dc35b11b
@@ -1439,13 +1439,6 @@ purple_xfer_start(PurpleXfer *xfer, int 
 
 	purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_STARTED);
 
-	/*
-	 * FIXME 3.0.0 -- there's too much broken code depending on fd == 0
-	 * meaning "don't use a real fd"
-	 */
-	if (fd == 0)
-		fd = -1;
-
 	if (type == PURPLE_XFER_RECEIVE) {
 		cond = PURPLE_INPUT_READ;
 
============================================================
--- libpurple/ft.h	37623e2c2b5be65199fa0592761947684f152210
+++ libpurple/ft.h	ac574db4985013de3bd46c46ce337a88e694d8fe
@@ -637,11 +637,8 @@ gssize purple_xfer_write(PurpleXfer *xfe
  * file receive transfer. On send, @a fd must be specified, and
  * @a ip and @a port are ignored.
  *
- * Prior to libpurple 2.6.0, passing '0' to @a fd was special-cased to
- * allow the protocol plugin to facilitate the file transfer itself. As of
- * 2.6.0, this is supported (for backward compatibility), but will be
- * removed in libpurple 3.0.0. If a prpl detects that the running libpurple
- * is running 2.6.0 or higher, it should use the invalid fd '-1'.
+ * Passing @a fd as '-1' is a special-case and indicates to the
+ * protocol plugin to facilitate the file transfer itself.
  *
  * @param xfer The file transfer.
  * @param fd   The file descriptor for the socket.


More information about the Commits mailing list