directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [31/44] directory-kerby git commit: Use readFully instead of read for being more robust, according to Steve review
Date Thu, 30 Jun 2016 08:54:18 GMT
Use readFully instead of read for being more robust, according to Steve review


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/8da8d90a
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/8da8d90a
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/8da8d90a

Branch: refs/heads/gssapi
Commit: 8da8d90a3bcb1a29a5cc40af196efd04b5cb6e73
Parents: 9989694
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Mon Jun 13 20:22:26 2016 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Mon Jun 13 20:22:26 2016 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/8da8d90a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java
b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java
index 9611fe0..1e0729d 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/KrbInputStream.java
@@ -73,9 +73,7 @@ public abstract class KrbInputStream extends DataInputStream {
         }
 
         byte[] data = new byte[len];
-        if (read(data) == -1) {
-            throw new IOException("Unexpected end of stream");
-        }
+        readFully(data);
 
         return data;
     }


Mime
View raw message