diff options
author | therealbobo | 2020-09-12 15:40:02 +0000 |
---|---|---|
committer | therealbobo | 2020-09-12 15:40:02 +0000 |
commit | 523ed67dc2d0f800efc68d414b37bb001535d3ee (patch) | |
tree | 3cd011b59c88f675e1b9d7635868a4748c267b6c | |
parent | d67d6c7b59c0454e0fdfdc3adcfd2064c9b1810e (diff) |
added decoded_content field
-rw-r--r-- | connection_streams_controller.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/connection_streams_controller.go b/connection_streams_controller.go index 000e3d4..096210e 100644 --- a/connection_streams_controller.go +++ b/connection_streams_controller.go @@ -27,6 +27,7 @@ type PatternSlice [2]uint64 type Payload struct { FromClient bool `json:"from_client"` Content string `json:"content"` + DecodedContent string `json:"decoded_content"` Index int `json:"index"` Timestamp time.Time `json:"timestamp"` IsRetransmitted bool `json:"is_retransmitted"` @@ -92,6 +93,7 @@ func (csc ConnectionStreamsController) GetConnectionPayload(c context.Context, c payload = Payload{ FromClient: true, Content: DecodeBytes(clientStream.Payload[start:end], format.Format), + //Request: ReadRequest(content), Index: start, Timestamp: clientStream.BlocksTimestamps[clientBlocksIndex], IsRetransmitted: clientStream.BlocksLoss[clientBlocksIndex], @@ -111,14 +113,14 @@ func (csc ConnectionStreamsController) GetConnectionPayload(c context.Context, c size := uint64(end - start) content := DecodeBytes(serverStream.Payload[start:end], format.Format) - // check if is encoded - if format.Format == "default" { - content = DecodeHttpResponse(content) - } + + plainContent := DecodeBytes(serverStream.Payload[start:end], "default") + decodedContent := DecodeBytes([]byte(DecodeHttpResponse(plainContent)), format.Format) payload = Payload{ FromClient: false, Content: content, + DecodedContent: decodedContent, Index: start, Timestamp: serverStream.BlocksTimestamps[serverBlocksIndex], IsRetransmitted: serverStream.BlocksLoss[serverBlocksIndex], |