diff --git a/PLUGIN-INF/metadata_SLUBVirusCheckClamAVPlugin.xml b/PLUGIN-INF/metadata_SLUBVirusCheckClamAVPlugin.xml index e765e8159727a7db375ab982a615a29982b43f4c..279f495de3af397bcdc6fa05b7912a36d51e9728 100644 --- a/PLUGIN-INF/metadata_SLUBVirusCheckClamAVPlugin.xml +++ b/PLUGIN-INF/metadata_SLUBVirusCheckClamAVPlugin.xml @@ -49,7 +49,7 @@ </fr:x_form> </pl:initParameters> <pl:description>SLUB Virus Check Plugin using installed ClamAV daemon via tcp-sockets</pl:description> - <pl:version>1.5</pl:version> + <pl:version>1.6</pl:version> <pl:materialType>DIGITAL</pl:materialType> <pl:module>Repository</pl:module> <pl:generalType>TASK</pl:generalType> diff --git a/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java b/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java index a133abcaaf6ac0b47c152bdfd489a5cbbcb54ce4..d8f569f2d20d563e8b061fb39ff2bacc71a1698a 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java +++ b/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java @@ -186,6 +186,16 @@ public class SLUBVirusCheckClamAVPlugin implements VirusCheckPlugin { //System.out.println("Could not set socket timeout to " + getTimeOut() + "ms " + e); log.error( "Could not set socket timeout to " + getTimeOut() + "ms", e); } + try { + socket.setKeepAlive(true); + } catch (SocketException e) { + log.error( "Could not enable KeepAlive", e); + } + try { + socket.setReuseAddress( true ); + } catch (SocketException e) { + log.error( "Could not set ReUseAddress", e); + } return socket; } @@ -286,7 +296,7 @@ public class SLUBVirusCheckClamAVPlugin implements VirusCheckPlugin { //System.out.println("clamd protocol not fully implemented"); } } catch (IOException e) { - log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e); + log.error("exception creation socket in scan(), clamd not available at host=" + host + "port=" + port, e); //System.out.println("exception creation socket, clamd not available at host=" + host + "port=" + port + " " + e); setStatus(Status.FAILED); setSignature("ERROR: clamd not available"); @@ -314,7 +324,7 @@ public class SLUBVirusCheckClamAVPlugin implements VirusCheckPlugin { callSocketCommand(socket, command); return response.trim(); } catch (IOException e) { - log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e); + log.error("exception creation socket in getAgent(), clamd not available at host=" + host + "port=" + port, e); //System.out.println("exception creation socket, clamd not available at host=" + host + "port=" + port + " " + e); setStatus(Status.FAILED); setSignature("ERROR: clamd not available");