Bugfix: Don't pad HexDump unless it's the last protocol
This commit is contained in:
parent
488a2ea730
commit
9c319f97e5
@ -110,7 +110,7 @@ QVariant HexDumpProtocol::fieldData(int index, FieldAttrib attrib,
|
|||||||
case FieldTextValue:
|
case FieldTextValue:
|
||||||
case FieldFrameValue:
|
case FieldFrameValue:
|
||||||
ba.append(data.content().c_str(), data.content().length());
|
ba.append(data.content().c_str(), data.content().length());
|
||||||
if (data.pad_until_end())
|
if (padUntilEnd())
|
||||||
{
|
{
|
||||||
pad = QByteArray(
|
pad = QByteArray(
|
||||||
protocolFrameSize(streamIndex) - ba.size(), '\0');
|
protocolFrameSize(streamIndex) - ba.size(), '\0');
|
||||||
@ -144,7 +144,7 @@ QVariant HexDumpProtocol::fieldData(int index, FieldAttrib attrib,
|
|||||||
switch(attrib)
|
switch(attrib)
|
||||||
{
|
{
|
||||||
case FieldValue:
|
case FieldValue:
|
||||||
return data.pad_until_end();
|
return padUntilEnd();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ int HexDumpProtocol::protocolFrameSize(int streamIndex) const
|
|||||||
{
|
{
|
||||||
int len = data.content().size();
|
int len = data.content().size();
|
||||||
|
|
||||||
if (data.pad_until_end())
|
if (padUntilEnd())
|
||||||
{
|
{
|
||||||
int pad = mpStream->frameLen(streamIndex)
|
int pad = mpStream->frameLen(streamIndex)
|
||||||
- (protocolFrameOffset(streamIndex)
|
- (protocolFrameOffset(streamIndex)
|
||||||
@ -212,3 +212,10 @@ int HexDumpProtocol::protocolFrameSize(int streamIndex) const
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HexDumpProtocol::padUntilEnd() const
|
||||||
|
{
|
||||||
|
if (next)
|
||||||
|
return false; // No padding if we are not the last protocol
|
||||||
|
|
||||||
|
return data.pad_until_end();
|
||||||
|
}
|
||||||
|
@ -68,6 +68,8 @@ public:
|
|||||||
virtual int protocolFrameSize(int streamIndex = 0) const;
|
virtual int protocolFrameSize(int streamIndex = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool padUntilEnd() const;
|
||||||
|
|
||||||
OstProto::HexDump data;
|
OstProto::HexDump data;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user