@@ -397,7 +397,7 @@ def __init__(self, name=None,
397397 # as there would be no time at all to wait for the response. But we'll allow you to
398398 # find that for yourself.
399399 if response_wait_interval < 0 :
400- response_wait_interval = 60 * 60 * 1000
400+ response_wait_interval = 60 * 60 * 1000
401401 self .__response_wait_interval = response_wait_interval
402402
403403 if model_queue_name and reply_queue_name :
@@ -542,7 +542,10 @@ def unpack(message: bytes) -> tuple[dict, CFH]:
542542 if parameter .StringLength > 1 :
543543 parameter = CFST (StringLength = parameter .StringLength )
544544 parameter .unpack (message [cursor :cursor + parameter .StrucLength ])
545- value = parameter .String
545+ # The parameter.String contents might include padding bytes that round up the length.
546+ # Ideally we'd truncate, but this was behaviour in the original library so I'm reluctant
547+ # to fix it.
548+ value = parameter .String # [:parameter.StringLength] - would truncate
546549 elif parameter_type == CMQCFC .MQCFT_STRING_LIST :
547550 parameter = CFSL ()
548551 parameter .unpack (message [cursor :cursor + CMQCFC .MQCFSL_STRUC_LENGTH_FIXED ])
@@ -551,6 +554,8 @@ def unpack(message: bytes) -> tuple[dict, CFH]:
551554 Count = parameter .Count ,
552555 StrucLength = parameter .StrucLength )
553556 parameter .unpack (message [cursor :cursor + parameter .StrucLength ])
557+ # CFSL doesn't have the same padding issue as CFST as all supported
558+ # attributes are multiples of 4.
554559 value = parameter .Strings
555560 elif parameter_type == CMQCFC .MQCFT_INTEGER :
556561 parameter = CFIN ()
0 commit comments