[Refactoring] Member "recordFromBeggining" removed from class RfbProto. Added "rec != null" test to tight decoder record methods that located in RfbProto class. Method "isRecordFromBeggining" of class VncCanvas always returns false.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3466 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/src/com/tightvnc/vncviewer/RfbProto.java b/java/src/com/tightvnc/vncviewer/RfbProto.java
index 5731bf0..5153253 100644
--- a/java/src/com/tightvnc/vncviewer/RfbProto.java
+++ b/java/src/com/tightvnc/vncviewer/RfbProto.java
@@ -184,11 +184,6 @@
   // containing Zlib-, ZRLE- or Tight-encoded data.
   boolean wereZlibUpdates = false;
 
-  // This will be set to false if the startSession() was called after
-  // we have received at least one Zlib-, ZRLE- or Tight-encoded
-  // framebuffer update.
-  boolean recordFromBeginning = true;
-
   // This fields are needed to show warnings about inefficiently saved
   // sessions only once per each saved session file.
   boolean zlibWarningShown;
@@ -689,8 +684,6 @@
     //        we should maintain separate flags for Zlib, ZRLE and
     //        Tight, instead of one ``wereZlibUpdates'' variable.
     //
-    if (wereZlibUpdates)
-      recordFromBeginning = false;
 
     zlibWarningShown = false;
     tightWarningShown = false;
@@ -880,10 +873,6 @@
       }
     }
 
-    if (rec != null && recordFromBeginning)
-      for (int i = 0; i < byteCount; i++)
-	rec.writeByte(portion[i]);
-
     return len;
   }
 
@@ -1431,7 +1420,7 @@
     deflater.finish();
     int compressedSize = deflater.deflate(buf);
     recordCompactLen(compressedSize);
-    rec.write(buf, 0, compressedSize);
+    if (rec != null) rec.write(buf, 0, compressedSize);
   }
 
   void recordCompressedData(byte[] data) throws IOException {
@@ -1456,7 +1445,7 @@
 	buf[bytes++] = (byte)(len >> 14 & 0xFF);
       }
     }
-    rec.write(buf, 0, bytes);
+    if (rec != null) rec.write(buf, 0, bytes);
   }
 
   public void startTiming() {
diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java
index 051928a..23361c5 100644
--- a/java/src/com/tightvnc/vncviewer/VncCanvas.java
+++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java
@@ -1281,7 +1281,8 @@
   //
 
   public boolean isRecordFromBeginning() {
-    return rfb.recordFromBeginning;
+    return false;
+    //return rfb.recordFromBeginning;
   }
 
   public boolean canWrite() {