dns: fix state progress handling

pull/1606/head
Victor Julien 11 years ago
parent b0f5f7ee97
commit c419f33f44

@ -223,8 +223,8 @@ uint64_t DNSGetTxCnt(void *alstate)
int DNSGetAlstateProgress(void *tx, uint8_t direction) int DNSGetAlstateProgress(void *tx, uint8_t direction)
{ {
DNSTransaction *dns_tx = (DNSTransaction *)tx; DNSTransaction *dns_tx = (DNSTransaction *)tx;
if (direction == 1) if (direction & STREAM_TOCLIENT)
return dns_tx->replied|dns_tx->reply_lost; return (dns_tx->replied|dns_tx->reply_lost) ? 2 : 1;
else { else {
/* toserver/query is complete if we have stored a query */ /* toserver/query is complete if we have stored a query */
return (TAILQ_FIRST(&dns_tx->query_list) != NULL); return (TAILQ_FIRST(&dns_tx->query_list) != NULL);
@ -237,6 +237,9 @@ int DNSGetAlstateProgress(void *tx, uint8_t direction)
*/ */
int DNSGetAlstateProgressCompletionStatus(uint8_t direction) int DNSGetAlstateProgressCompletionStatus(uint8_t direction)
{ {
if (direction & STREAM_TOCLIENT)
return 2;
else
return 1; return 1;
} }

Loading…
Cancel
Save