You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2021/07/14 07:11:36 UTC
[sling-org-apache-sling-launchpad-base] branch master updated:
SLING-10580 - While receiving commands,
SocketException is not handled in readline()
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 <an...@gmail.com>
AuthorDate: Wed Jul 14 12:41:30 2021 +0530
SLING-10580 - While receiving commands, SocketException is not handled in readline()
Co-authored-by: ankitaag <an...@adobe.com>
---
.../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);