Skip to content

Commit

Permalink
fix: 4.0-RC1问题修复:logView解析+进入Transaction等页面白屏
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsky1 authored and qmwu2000 committed Jan 4, 2025
1 parent 60693f7 commit e815e74
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ public ModelResponse<T> invoke(ModelRequest request) {

t.addData(url.toString());

InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(10000).openStream(url.toExternalForm());
GZIPInputStream gzip = new GZIPInputStream(in);
String xml = Files.forIO().readFrom(gzip, "utf-8");
InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(10000).withGzip().openStream(url.toExternalForm());
String xml = Files.forIO().readFrom(in, "utf-8");

int len = xml == null ? 0 : xml.length();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private String buildNewReport(ModelRequest request, ModelPeriod period, String d
MessageTree tree = null;

if (buf != null) {
tree = CodecHandler.decode(buf);
tree = CodecHandler.decode(changeBuf(buf));
}

if (tree == null) {
Expand All @@ -101,7 +101,7 @@ private String buildNewReport(ModelRequest request, ModelPeriod period, String d
ByteBuf data = bucket.get(id);

if (data != null) {
tree = CodecHandler.decode(data);
tree = CodecHandler.decode(changeBuf(data));
}
}
}
Expand All @@ -126,6 +126,17 @@ private String buildNewReport(ModelRequest request, ModelPeriod period, String d
return null;
}

private ByteBuf changeBuf(ByteBuf data) {
data.markReaderIndex();
int length = data.readInt();
data.resetReaderIndex();
ByteBuf readBytes = data.readBytes(length + 4);

readBytes.markReaderIndex();
readBytes.readInt();
return readBytes;
}

public String buildOldReport(ModelRequest request, ModelPeriod period, String domain, ApiPayload payload)
throws Exception {
String messageId = payload.getMessageId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ public ModelResponse<String> invoke(ModelRequest request) {

t.addData(url.toString());

InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(5000).openStream(url.toExternalForm());
GZIPInputStream gzip = new GZIPInputStream(in);
String xml = Files.forIO().readFrom(gzip, "utf-8");
InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(5000).withGzip().openStream(url.toExternalForm());
String xml = Files.forIO().readFrom(in, "utf-8");

int len = xml == null ? 0 : xml.length();

Expand Down

0 comments on commit e815e74

Please sign in to comment.