]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] Graceful fallback to non-indexed seeking if Range headers in HTTP reque...
authorConstantin Kaplinsky <const@tightvnc.com>
Mon, 23 Jun 2008 11:38:51 +0000 (11:38 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Mon, 23 Jun 2008 11:38:51 +0000 (11:38 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2617 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/rfbplayer/FbsConnection.java

index aa45d7d3f0b2af9825e84de59b4714b9ea6fb9c2..3e9e3a57ad58feda863f4b7ded4fa5b1efb67833 100644 (file)
@@ -223,19 +223,23 @@ public class FbsConnection {
     }
 
     // Seek to the keyframe.
-    // FIXME: Check return value of openHttpByteRange(), it can be null.
     InputStream is = openHttpByteRange(fbkURL, entry.key_fpos, entry.key_size);
-    DataInputStream data = new DataInputStream(is);
+    if (is == null) {
+      return null;
+    }
 
     // Load keyframe data from the .fbk file, prepend RFB initialization data.
+    DataInputStream data = new DataInputStream(is);
     byte[] keyData = new byte[rfbInitData.length + (int)entry.key_size];
     System.arraycopy(rfbInitData, 0, keyData, 0, rfbInitData.length);
     data.readFully(keyData, rfbInitData.length, (int)entry.key_size);
     data.close();
 
     // Open the FBS stream.
-    // FIXME: Check return value of openHttpByteRange(), it can be null.
     is = openHttpByteRange(fbsURL, entry.fbs_fpos, -1);
+    if (is == null) {
+      return null;
+    }
     return new FbsInputStream(is, entry.timestamp, keyData, entry.fbs_skip);
   }