From dea56f7ec55426553bdac8ad20e22e0b0458cf96 Mon Sep 17 00:00:00 2001 From: flashine Date: Fri, 8 Jul 2022 11:58:13 +0800 Subject: [PATCH] =?UTF-8?q?optimize=20:=20=E8=B0=83=E6=95=B4=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E4=B8=BA2?= =?UTF-8?q?=E5=88=86=E9=92=9F=EF=BC=9B=20=E9=BB=98=E8=AE=A4=E8=AF=B7?= =?UTF-8?q?=E6=B1=8210s=E8=B6=85=E6=97=B6=EF=BC=8C=E5=BD=93maxsize?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=A4=A7=E5=80=BC10000=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=97=B6=E9=97=B4=E8=BF=87=E9=95=BF=EF=BC=8C=E4=BB=8E?= =?UTF-8?q?=E8=80=8C=E8=B6=85=E5=87=BA10s=E6=97=B6=E9=97=B4=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/fofaviewer/controllers/MainController.java | 2 +- src/main/java/org/fofaviewer/main/MainApp.java | 2 +- src/main/java/org/fofaviewer/request/Request.java | 2 +- src/main/java/org/fofaviewer/utils/RequestUtil.java | 6 +++--- src/main/resources/tinylog.properties | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/fofaviewer/controllers/MainController.java b/src/main/java/org/fofaviewer/controllers/MainController.java index b6dc7a6..dbc94a8 100644 --- a/src/main/java/org/fofaviewer/controllers/MainController.java +++ b/src/main/java/org/fofaviewer/controllers/MainController.java @@ -652,7 +652,7 @@ private void addScrollBarListener(TableView view){ @Override protected Void call() { HashMap result = helper.getHTML(client.getParam(String.valueOf(bean.page), - isAll.isSelected()) + helper.encode(text), 10000, 10000); + isAll.isSelected()) + helper.encode(text), 120000, 120000); TableView tableView = (TableView) ((BorderPane) tab.getContent()).getCenter(); if (result.get("code").equals("200")) { JSONObject obj = JSON.parseObject(result.get("msg")); diff --git a/src/main/java/org/fofaviewer/main/MainApp.java b/src/main/java/org/fofaviewer/main/MainApp.java index 09e696c..84db213 100644 --- a/src/main/java/org/fofaviewer/main/MainApp.java +++ b/src/main/java/org/fofaviewer/main/MainApp.java @@ -7,7 +7,7 @@ import org.fofaviewer.controllers.MainController; public class MainApp extends Application { - private final String version = "1.1.9"; + private final String version = "1.1.10"; @Override public void start(Stage stage) throws Exception { diff --git a/src/main/java/org/fofaviewer/request/Request.java b/src/main/java/org/fofaviewer/request/Request.java index ab69a69..f26c9da 100644 --- a/src/main/java/org/fofaviewer/request/Request.java +++ b/src/main/java/org/fofaviewer/request/Request.java @@ -48,7 +48,7 @@ public void query(int connection){ bean.setRequestStatus(RequestStatus.RUNNING); TabDataBean _tmp = new TabDataBean(); Platform.runLater(() -> this.callback.before(_tmp, bean)); - HashMap res = RequestUtil.getInstance().getHTML(bean.getRequestUrl(), 10000, 10000); + HashMap res = RequestUtil.getInstance().getHTML(bean.getRequestUrl(), 120000, 120000); bean.setResult(res); if (res.get("code").equals("error") || !res.get("code").equals("200")) { bean.setRequestStatus(RequestStatus.FAILED); diff --git a/src/main/java/org/fofaviewer/utils/RequestUtil.java b/src/main/java/org/fofaviewer/utils/RequestUtil.java index 1244a18..904c2b5 100644 --- a/src/main/java/org/fofaviewer/utils/RequestUtil.java +++ b/src/main/java/org/fofaviewer/utils/RequestUtil.java @@ -76,7 +76,7 @@ public HashMap getHTML(String url, int connectTimeout, int socks .socksTimeout(socksTimeout) .send(); }catch (Exception e){ - Logger.warn(e); + Logger.warn(url + e.getMessage()); result.put("code", "error"); result.put("msg", e.getMessage()); return result; @@ -155,7 +155,7 @@ public HashMap getImageFavicon(String url) { } public String getLinkIcon(String url) { - HashMap result = getHTML(url, 10000,10000); + HashMap result = getHTML(url, 60000,60000); if (result.get("code").equals("200")) { Document document = Jsoup.parse(result.get("msg")); Elements elements = document.getElementsByTag("link"); @@ -250,7 +250,7 @@ public Map getTips(String key) { String ts = String.valueOf((new Timestamp(System.currentTimeMillis())).getTime()); String singParam = "q" + key + "ts" + ts; String params = URLEncoder.encode(key,"UTF-8") + "&ts=" + ts + "&sign=" + URLEncoder.encode(getInputSign(singParam), "utf-8") + "&app_id=" + this.appId; - HashMap result = getHTML(FofaConfig.TIP_API + params, 3000, 5000); + HashMap result = getHTML(FofaConfig.TIP_API + params, 5000, 10000); if (result.get("code").equals("200")) { JSONObject obj = JSON.parseObject(result.get("msg")); if(obj.getInteger("code") == 0){ diff --git a/src/main/resources/tinylog.properties b/src/main/resources/tinylog.properties index cde5434..b820f91 100644 --- a/src/main/resources/tinylog.properties +++ b/src/main/resources/tinylog.properties @@ -1,5 +1,5 @@ writer1=rolling file -writer1.level=error +writer1.level=error,warn writer1.format={date:yyyy-MM-dd HH:mm:ss.SSS} {level} {file}.java:{line}-{method}:\n{message} writer1.file=log/error_{date:yyyy-MM-dd}.log writer1.append=true @@ -8,4 +8,5 @@ writer1.writingthread=true writer1.policies = startup writer2=console writer2.level=warn +writer2.append=true writer2.format={date:yyyy-MM-dd HH:mm:ss.SSS} {level} {file}.java:{line}-{method}:\n{message} \ No newline at end of file