Land #9045, Copy original request ID into TLV response

bug/bundler_fix
William Webb 2017-10-09 10:58:02 -05:00
commit 14308fb77d
No known key found for this signature in database
GPG Key ID: 341763D0308DA650
1 changed files with 12 additions and 1 deletions

View File

@ -705,6 +705,7 @@ class Packet < GroupTlv
def Packet.create_response(request = nil)
response_type = PACKET_TYPE_RESPONSE
method = nil
id = nil
if (request)
if (request.type?(PACKET_TYPE_PLAIN_REQUEST))
@ -712,9 +713,19 @@ class Packet < GroupTlv
end
method = request.method
if request.has_tlv?(TLV_TYPE_REQUEST_ID)
id = request.get_tlv_value(TLV_TYPE_REQUEST_ID)
end
end
Packet.new(response_type, method)
packet = Packet.new(response_type, method)
if id
packet.add_tlv(TLV_TYPE_REQUEST_ID, id)
end
packet
end
##