Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset link credit on last transfer legally received #465

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include "azure_uamqp_c/amqp_frame_codec.h"
#include "azure_uamqp_c/async_operation.h"

#define DEFAULT_LINK_CREDIT 10000
#define DEFAULT_LINK_CREDIT 10
#define RECEIVER_MIN_LINK_CREDIT 1

typedef struct DELIVERY_INSTANCE_TAG
{
Expand Down Expand Up @@ -423,7 +424,7 @@ static void link_frame_received(void* context, AMQP_VALUE performative, uint32_t
bool more;
bool is_error;

if (link_instance->current_link_credit == 0)
if (link_instance->current_link_credit <= RECEIVER_MIN_LINK_CREDIT)
{
link_instance->current_link_credit = link_instance->max_link_credit;
send_flow(link_instance);
Expand Down