CVS: rdesktop cliprdr.c,1.26,1.27

Pierre Ossman <[email protected]> Mon, 27 Mar 2006 00:30:28 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3680

Modified Files:
	cliprdr.c 
Log Message:
Make a copy of the formats list so that we can properly resend it when the
server is too busy to accept it.


Index: cliprdr.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/cliprdr.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** cliprdr.c	27 Mar 2006 08:24:41 -0000	1.26
--- cliprdr.c	27 Mar 2006 08:30:15 -0000	1.27
***************
*** 34,37 ****
--- 34,40 ----
  static VCHANNEL *cliprdr_channel;
  
+ static uint8 *last_formats = NULL;
+ static uint32 last_formats_length = 0;
+ 
  static void
  cliprdr_send_packet(uint16 type, uint16 status, uint8 * data, uint32 length)
***************
*** 76,81 ****
--- 79,95 ----
  {
  	DEBUG_CLIPBOARD(("cliprdr_send_native_format_announce\n"));
+ 
  	cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, formats_data,
  			    formats_data_length);
+ 
+ 	if (formats_data != last_formats)
+ 	{
+ 		if (last_formats)
+ 			xfree(last_formats);
+ 
+ 		last_formats = xmalloc(formats_data_length);
+ 		memcpy(last_formats, formats_data, formats_data_length);
+ 		last_formats_length = formats_data_length;
+ 	}
  }
  
***************
*** 117,121 ****
  			/* FIXME: We seem to get this when we send an announce while the server is
  			   still processing a paste. Try sending another announce. */
! 			cliprdr_send_simple_native_format_announce(CF_TEXT);
  			return;
  		}
--- 131,135 ----
  			/* FIXME: We seem to get this when we send an announce while the server is
  			   still processing a paste. Try sending another announce. */
! 			cliprdr_send_native_format_announce(last_formats, last_formats_length);
  			return;
  		}



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642