libfreerdp-core: parse all updates in the update array
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Sun, 7 Aug 2011 13:27:52 +0000 (09:27 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Sun, 7 Aug 2011 13:27:52 +0000 (09:27 -0400)
libfreerdp-core/update.c

index ce3ea9e..52c3b02 100644 (file)
@@ -189,6 +189,25 @@ void update_recv(rdpUpdate* update, STREAM* s)
        }
 
        IFCALL(update->EndPaint, update);
+
+       if (stream_get_left(s) > RDP_SHARE_DATA_HEADER_LENGTH)
+       {
+               uint8 type;
+               uint16 pduType;
+               uint16 length;
+               uint16 source;
+               uint32 shareId;
+
+               rdp_read_share_control_header(s, &length, &pduType, &source);
+
+               if (pduType != PDU_TYPE_DATA)
+                       return;
+
+               rdp_read_share_data_header(s, &length, &type, &shareId);
+
+               if (type == DATA_PDU_TYPE_UPDATE)
+                       update_recv(update, s);
+       }
 }
 
 rdpUpdate* update_new(rdpRdp* rdp)