(Packet packet)
| 200 | private Map<Long, Long> groupMap = new HashMap<>(); |
| 201 | |
| 202 | public void setGroupId(Packet packet) throws Exception { |
| 203 | byte[] data = (packet.getDecodedData().length > 0) ? packet.getDecodedData() : packet.getModifiedData(); |
| 204 | Http http = Http.create(data); |
| 205 | String streamIdStr = http.getFirstHeader("X-PacketProxy-HTTP2-Stream-Id"); |
| 206 | if (streamIdStr != null && streamIdStr.length() > 0) { |
| 207 | |
| 208 | long streamId = Long.parseLong(streamIdStr); |
| 209 | if (groupMap.containsKey(streamId)) { |
| 210 | |
| 211 | packet.setGroup(groupMap.get(streamId)); |
| 212 | } else { |
| 213 | |
| 214 | long groupId = UniqueID.getInstance().createId(); |
| 215 | groupMap.put(streamId, groupId); |
| 216 | packet.setGroup(groupId); |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | } |
no test coverage detected