Bug: https://bugzilla.samba.org/show_bug.cgi?id=9702
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 29 14:58:40 CET 2015 on sn-devel-104
(similar to commit
8aed0fc38ae28cce7fd1a443844a865265fc719c)
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Feb 5 23:44:30 CET 2015 on sn-devel-104
*/
credits_granted = 0;
} else {
+ uint16_t additional_possible =
+ sconn->smb2.max_credits - credit_charge;
uint16_t additional_max = 0;
uint16_t additional_credits = credits_requested - 1;
break;
}
+ additional_max = MIN(additional_max, additional_possible);
additional_credits = MIN(additional_credits, additional_max);
credits_granted = credit_charge + additional_credits;