Skip to content

Commit

Permalink
[+] add sending for path standby and available
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanmei-Liu committed Oct 26, 2023
1 parent fbaba35 commit f1ca7d4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/transport/xqc_multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,13 @@ xqc_set_application_path_status(xqc_path_ctx_t *path, xqc_app_path_status_t stat
path->app_path_status = status;

if (is_tx) {
xqc_int_t ret = xqc_write_path_status_frame_to_packet(conn, path);
xqc_int_t ret = XQC_ERROR;
if (conn->conn_settings.multipath_version >= XQC_MULTIPATH_06) {
ret = xqc_write_path_standby_or_available_frame_to_packet(conn, path);
} else {
ret = xqc_write_path_status_frame_to_packet(conn, path);
}

if (ret != XQC_OK) {
path->app_path_status = last_status;
xqc_log(conn->log, XQC_LOG_ERROR, "|xqc_write_path_status_frame_to_packet error|%d|", ret);
Expand Down
17 changes: 13 additions & 4 deletions src/transport/xqc_packet_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ xqc_write_path_status_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *pa


xqc_int_t
xqc_write_path_standby_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *path)
xqc_write_path_standby_or_available_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *path)
{
xqc_int_t ret = XQC_ERROR;

Expand All @@ -1453,10 +1453,19 @@ xqc_write_path_standby_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *p

path->app_path_status_send_seq_num++;

ret = xqc_gen_path_status_frame(conn, packet_out, path->path_scid.cid_seq_num,
path->app_path_status_send_seq_num, (uint64_t)path->app_path_status);
if (path->app_path_status == XQC_APP_PATH_STATUS_STANDBY) {
ret = xqc_gen_path_standby_frame(conn, packet_out, path->path_scid.cid_seq_num,
path->app_path_status_send_seq_num);
} else if (path->app_path_status == XQC_APP_PATH_STATUS_AVAILABLE) {
ret = xqc_gen_path_available_frame(conn, packet_out, path->path_scid.cid_seq_num,
path->app_path_status_send_seq_num);
} else {
xqc_log(conn->log, XQC_LOG_WARN, "|xqc_write_path_standby_or_available_frame_to_packet status error|%d|", path->app_path_status);
return -XQC_EMP_PATH_STATE_ERROR;
}

if (ret < 0) {
xqc_log(conn->log, XQC_LOG_ERROR, "|xqc_gen_path_status_frame error|%d|", ret);
xqc_log(conn->log, XQC_LOG_ERROR, "|xqc_write_path_standby_or_available_frame_to_packet error|%d|", ret);
goto error;
}

Expand Down
2 changes: 2 additions & 0 deletions src/transport/xqc_packet_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ xqc_int_t xqc_write_path_abandon_frame_to_packet(xqc_connection_t *conn, xqc_pat

xqc_int_t xqc_write_path_status_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *path);

xqc_int_t xqc_write_path_standby_or_available_frame_to_packet(xqc_connection_t *conn, xqc_path_ctx_t *path);

int xqc_write_pmtud_ping_to_packet(xqc_path_ctx_t *path, size_t probing_size, xqc_pkt_type_t pkt_type);


Expand Down

0 comments on commit f1ca7d4

Please sign in to comment.