CVS: rdesktop rdesktop.c,1.126,1.127 rdp.c,1.86,1.87

Michael Gernoth <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16265

Modified Files:
	rdesktop.c rdp.c 
Log Message:
Enable rdp-compression for all bpps.
Many thanks to Vahur Sinijärv <[email protected]> for
finding the fix.


Index: rdesktop.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -d -r1.126 -r1.127
*** rdesktop.c	4 Apr 2005 16:37:19 -0000	1.126
--- rdesktop.c	16 Apr 2005 11:42:33 -0000	1.127
***************
*** 86,89 ****
--- 86,90 ----
  BOOL g_owncolmap = False;
  BOOL g_ownbackstore = True;	/* We can't rely on external BackingStore */
+ BOOL g_rdp_compression = False;
  uint32 g_embed_wnd;
  uint32 g_rdp5_performanceflags =
***************
*** 576,579 ****
--- 577,581 ----
  				DEBUG(("rdp compression enabled\n"));
  				flags |= RDP_COMPRESSION;
+ 				g_rdp_compression = True;
  				break;
  
***************
*** 741,750 ****
  	}
  
- 	if ((flags & RDP_COMPRESSION) && (g_server_bpp > 8))
- 	{
- 		warning("rdp compression not supported for bpp > 8, compression disabled\n");
- 		flags ^= RDP_COMPRESSION;
- 	}
- 
  	if (prompt_password && read_password(password, sizeof(password)))
  		flags |= RDP_LOGON_AUTO;
--- 743,746 ----

Index: rdp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdp.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** rdp.c	3 Apr 2005 18:08:04 -0000	1.86
--- rdp.c	16 Apr 2005 11:42:34 -0000	1.87
***************
*** 50,53 ****
--- 50,54 ----
  extern BOOL g_bitmap_cache;
  extern BOOL g_bitmap_cache_persist_enable;
+ extern BOOL g_rdp_compression;
  
  uint8 *g_next_packet;
***************
*** 660,663 ****
--- 661,666 ----
  rdp_out_bmpcache2_caps(STREAM s)
  {
+ 	uint16 cellsize;
+ 
  	out_uint16_le(s, RDP_CAPSET_BMPCACHE2);
  	out_uint16_le(s, RDP_CAPLEN_BMPCACHE2);
***************
*** 665,669 ****
  	out_uint16_le(s, g_bitmap_cache_persist_enable ? 2 : 0);	/* version */
  
! 	out_uint16_le(s, 0x0300);	/* flags? number of caches? */
  
  	out_uint32_le(s, BMPCACHE2_C0_CELLS);
--- 668,691 ----
  	out_uint16_le(s, g_bitmap_cache_persist_enable ? 2 : 0);	/* version */
  
! 	/* Cellsize:
! 	   01 = 16x16, 02 = 32x32, 03 = 64x64
! 	   log2(cell size) - 3
! 	 */
! 
! 	cellsize = 0x03;
! 
! 	if (g_rdp_compression)
! 	{
! 		switch (g_server_bpp)
! 		{
! 			case 24:
! 			case 16:
! 			case 15:
! 				cellsize = 0x02;
! 				break;
! 		}
! 	}
! 
! 	out_uint16_le(s, (0x0000 | (cellsize << 8)));	/* flags? number of caches? */
  
  	out_uint32_le(s, BMPCACHE2_C0_CELLS);



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.