Skip to content

Commit

Permalink
fixup: remove dead code that sends detach
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti committed Nov 25, 2024
1 parent 8d39541 commit 181b374
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 22 deletions.
3 changes: 1 addition & 2 deletions include/qpid/dispatch/protocol_adaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ typedef void (*qdr_link_second_attach_t) (void *context,
* @param error Error record if the detach is the result of an error condition, null otherwise
* @param first True if this is the first detach (i.e. initiated outbound), False if this is the
* the response to a remotely initiated detach
* @param close True if this is a link close, False if this is a link detach
*/
typedef void (*qdr_link_detach_t) (void *context, qdr_link_t *link, qdr_error_t *error, bool first, bool close);
typedef void (*qdr_link_detach_t) (void *context, qdr_link_t *link, qdr_error_t *error, bool first);

/**
* qdr_link_flow_t callback
Expand Down
7 changes: 2 additions & 5 deletions src/adaptors/amqp/amqp_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ static void CORE_close_connection(void *context, qdr_connection_t *qdr_conn, qdr
}
}

static void CORE_link_detach(void *context, qdr_link_t *link, qdr_error_t *error, bool first, bool close)
static void CORE_link_detach(void *context, qdr_link_t *link, qdr_error_t *error, bool first)
{
qd_link_t *qlink = (qd_link_t*) qdr_link_get_context(link);
if (!qlink)
Expand Down Expand Up @@ -1949,10 +1949,7 @@ static void CORE_link_detach(void *context, qdr_link_t *link, qdr_error_t *error
}
}

if (close)
qd_link_close(qlink);
else
qd_link_detach(qlink);
qd_link_close(qlink);

//
// This is the last event for this link that we are going to send into Proton.
Expand Down
9 changes: 0 additions & 9 deletions src/adaptors/amqp/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,15 +911,6 @@ void qd_link_close(qd_link_t *link)
}


void qd_link_detach(qd_link_t *link)
{
if (link->pn_link) {
pn_link_detach(link->pn_link);
pn_link_close(link->pn_link);
}
}


/** sending link has entered Q3 flow control */
void qd_link_q3_block(qd_link_t *link)
{
Expand Down
1 change: 0 additions & 1 deletion src/adaptors/amqp/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ pn_terminus_t *qd_link_target(qd_link_t *link);
pn_terminus_t *qd_link_remote_source(qd_link_t *link);
pn_terminus_t *qd_link_remote_target(qd_link_t *link);
void qd_link_close(qd_link_t *link);
void qd_link_detach(qd_link_t *link);
void qd_link_free(qd_link_t *link);
void qd_link_q2_restart_receive(const qd_alloc_safe_ptr_t context);
void qd_link_q3_block(qd_link_t *link);
Expand Down
2 changes: 1 addition & 1 deletion src/adaptors/tcp/tcp_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ static void CORE_second_attach(void *context,
}


static void CORE_detach(void *context, qdr_link_t *link, qdr_error_t *error, bool first, bool close)
static void CORE_detach(void *context, qdr_link_t *link, qdr_error_t *error, bool first)
{
}

Expand Down
4 changes: 1 addition & 3 deletions src/router_core/connections.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ int qdr_connection_process(qdr_connection_t *conn)
case QDR_LINK_WORK_FIRST_DETACH :
case QDR_LINK_WORK_SECOND_DETACH :
conn->protocol_adaptor->detach_handler(conn->protocol_adaptor->user_context, link, link_work->error,
link_work->work_type == QDR_LINK_WORK_FIRST_DETACH,
link_work->close_link);
link_work->work_type == QDR_LINK_WORK_FIRST_DETACH);
detach_sent = true;
break;
}
Expand Down Expand Up @@ -1286,7 +1285,6 @@ void qdr_link_outbound_detach_CT(qdr_core_t *core, qdr_link_t *link, qdr_error_t

link->detach_count += 1;
qdr_link_work_t *work = qdr_link_work(link->detach_count == 1 ? QDR_LINK_WORK_FIRST_DETACH : QDR_LINK_WORK_SECOND_DETACH);
work->close_link = close;

if (error)
work->error = error;
Expand Down
1 change: 0 additions & 1 deletion src/router_core/router_core_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ typedef struct qdr_link_work_t {
qdr_error_t *error;
int value;
qdr_link_work_drain_action_t drain_action;
bool close_link;
bool processing;
} qdr_link_work_t;

Expand Down

0 comments on commit 181b374

Please sign in to comment.