summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSimon Rettberg2023-05-25 16:21:54 +0200
committerSimon Rettberg2023-05-25 16:21:54 +0200
commit16fb3761480aeee1cae1be06e5b9de237e2c7aac (patch)
tree0e05ff8c18235d25ce5e3d71ef83ab6dfb5f383a /src/main/java
parentBFTP: Minor cleanup, comments, refactor (diff)
downloadmaster-sync-shared-16fb3761480aeee1cae1be06e5b9de237e2c7aac.tar.gz
master-sync-shared-16fb3761480aeee1cae1be06e5b9de237e2c7aac.tar.xz
master-sync-shared-16fb3761480aeee1cae1be06e5b9de237e2c7aac.zip
TBinaryProtocolSafe: Silence more annoying messages
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java
index c3f4763..efa83c3 100644
--- a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java
+++ b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java
@@ -105,9 +105,10 @@ public class TBinaryProtocolSafe extends TBinaryProtocol
&& ( e.getCause().getMessage().contains( " timed out" ) || e.getCause().getMessage().contains( "Connection reset" ) ) ) {
// Faaaake
throw new TTransportException( TTransportException.END_OF_FILE );
- } else if ( e.getMessage().contains( "larger than max length" ) ) {
+ } else if ( e.getMessage().contains( "larger than max length" ) || e.getMessage().contains( "Read a negative frame size" ) ) {
// Also fake, since this one prints a whole stack trace compared to the other
// message by AbstractNonblockingServer
+ LOGGER.debug( e.getMessage(), e );
throw new TTransportException( TTransportException.END_OF_FILE );
}
throw e;
@@ -117,7 +118,8 @@ public class TBinaryProtocolSafe extends TBinaryProtocol
if ( size < 0 ) {
int version = size & VERSION_MASK;
if ( version != VERSION_1 ) {
- throw new TProtocolException( TProtocolException.BAD_VERSION, "Bad version in readMessageBegin" );
+ LOGGER.warn( getIp() + "Bad version (" + version + ") in readMessageBegin" );
+ throw new TTransportException( TTransportException.END_OF_FILE );
}
return new TMessage( readString(), (byte) ( size & 0x000000ff ), readI32() );
} else {