MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / setGroupId

Method setGroupId

src/main/java/core/packetproxy/http3/service/Http3.java:272–289  ·  view source on GitHub ↗
(Packet packet)

Source from the content-addressed store, hash-verified

270 private Map<Long, Long> groupMap = new HashMap<>();
271
272 public void setGroupId(Packet packet) throws Exception {
273 byte[] data = (packet.getDecodedData().length > 0) ? packet.getDecodedData() : packet.getModifiedData();
274 Http http = Http.create(data);
275 String streamIdStr = http.getFirstHeader("x-packetproxy-http3-stream-id");
276 if (streamIdStr != null && streamIdStr.length() > 0) {
277
278 long streamId = Long.parseLong(streamIdStr);
279 if (groupMap.containsKey(streamId)) {
280
281 packet.setGroup(groupMap.get(streamId));
282 } else {
283
284 long groupId = UniqueID.getInstance().createId();
285 groupMap.put(streamId, groupId);
286 packet.setGroup(groupId);
287 }
288 }
289 }
290
291}

Callers

nothing calls this directly

Calls 10

createMethod · 0.95
getFirstHeaderMethod · 0.95
getInstanceMethod · 0.95
getDecodedDataMethod · 0.80
getModifiedDataMethod · 0.80
lengthMethod · 0.80
setGroupMethod · 0.80
createIdMethod · 0.80
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected