This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-base.git
The following commit(s) were added to refs/heads/master by this push:
new 5befcac SLING-10580 - While receiving commands, SocketException is
not handled in readline()
5befcac is described below
commit 5befcac50197fc0a0c37942bcb68cdddf125c315
Author: Ankita Agarwal <[email protected]>
AuthorDate: Wed Jul 14 12:41:30 2021 +0530
SLING-10580 - While receiving commands, SocketException is not handled in
readline()
Co-authored-by: ankitaag <[email protected]>
---
.../java/org/apache/sling/launchpad/app/ControlListener.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/launchpad/app/ControlListener.java
b/src/main/java/org/apache/sling/launchpad/app/ControlListener.java
index 6e6284b..ac0af14 100644
--- a/src/main/java/org/apache/sling/launchpad/app/ControlListener.java
+++ b/src/main/java/org/apache/sling/launchpad/app/ControlListener.java
@@ -37,6 +37,7 @@ import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
+import java.net.SocketException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
@@ -214,7 +215,14 @@ class ControlListener implements Runnable {
}
try {
- final String commandLine = readLine(s);
+ String commandLine = null;
+ try {
+ commandLine = readLine(s);
+ } catch (SocketException ignore) {
+ Main.error("Failure in accessing a socket", ignore);
+ continue;
+ }
+
if (commandLine == null) {
final String msg = "ERR: missing command";
writeLine(s, msg);