summaryrefslogtreecommitdiffstats
path: root/java/src/com/tightvnc/rfbplayer
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-06-23 11:38:51 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-06-23 11:38:51 +0000
commitf5821e58e7b296897b72b3a1e568d91e6115f872 (patch)
tree60ec34ddea60b44f61a57a5c34c9055b482df3fe /java/src/com/tightvnc/rfbplayer
parenta9bb64f3ec4eb11896ea133450b87e7c9a589ff2 (diff)
downloadtigervnc-f5821e58e7b296897b72b3a1e568d91e6115f872.tar.gz
tigervnc-f5821e58e7b296897b72b3a1e568d91e6115f872.zip
[Development] Graceful fallback to non-indexed seeking if Range headers in HTTP requests are not supported by the HTTP server or HTTP proxy.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2617 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/src/com/tightvnc/rfbplayer')
-rw-r--r--java/src/com/tightvnc/rfbplayer/FbsConnection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/src/com/tightvnc/rfbplayer/FbsConnection.java b/java/src/com/tightvnc/rfbplayer/FbsConnection.java
index aa45d7d3..3e9e3a57 100644
--- a/java/src/com/tightvnc/rfbplayer/FbsConnection.java
+++ b/java/src/com/tightvnc/rfbplayer/FbsConnection.java
@@ -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);
}