Skip to content

Commit

Permalink
fix(DotClient): query ID
Browse files Browse the repository at this point in the history
if the message query ID is zero, then generate a new ID.
  • Loading branch information
richardschneider committed May 23, 2019
1 parent 4542d50 commit eb384e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ public override async Task<Message> QueryAsync(

byte[] BuildRequest(Message request)
{
// Always have a query ID.
if (request.Id == 0)
{
request.Id = this.NextQueryId();
}

// Add an OPT if not already present.
var opt = request.AdditionalRecords.OfType<OPTRecord>().FirstOrDefault();
if (opt == null)
Expand Down

0 comments on commit eb384e5

Please sign in to comment.