In the new version of the code, "add_capabilities()" always gets passed
a type of CONNECT, even for a CONNECTREPLY PDU.
The type is used by "add_capabilities()" to decide whether to pass TRUE
or FALSE as the second argument to "add_capability_vals()"; that second
argument specifies whether to add a string after the first byte of the
capability.
However, in the 5 July 2001 WSP specification, section 8.3.2.5 "Extended
Methods" says
When sent from client to server in the Connect PDU, the
capability-specific parameters for the Extended Methods
capability contain zero or more PDU Type to Method Name
assignments. The end of the list of assignments is determined
from the end of the capability as specified in the capability
length. Each capability assignment contains a PDU Type and a
Method Name. The PDU types are assigned by the client from the
range 0x50-0x5F for methods that use the Get PDU format and the
range 0x70-0x7F for methods that use the Post PDU format. The
method name is a null terminated string.
When sent from server to client in the ConnectReply PDU, the
capability-specific parameters for the Extended Methods
capability contain the zero or more PDU type codes (without the
method names) that the server accepts and can receive.
and the 4 May 2000 WSP specification says much the same thing.
Section 8.3.2.6 "Header Code Pages" says something similar.
This seems to imply that CONNECTREPLY should be passed, not CONNECT.
I.e., the code for CONNECT, CONNECTREPLY, and RESUME should, I think, do
if (capabilityLength > 0)
{
tmp_tvb = tvb_new_subset (tvb, offset, capabilityLength, capabilityLength);
add_capabilities (wsp_tree, tmp_tvb, pdut);
offset += capabilityLength;
}
rather than
if (capabilityLength > 0)
{
tmp_tvb = tvb_new_subset (tvb, offset, capabilityLength, capabilityLength);
add_capabilities (wsp_tree, tmp_tvb, CONNECT);
offset += capabilityLength;
}