mirror of
https://github.com/EndPositive/slipstream.git
synced 2025-10-08 12:25:04 +00:00
Random path for polls
This commit is contained in:
parent
ee59a67164
commit
ec409d4ca8
2 changed files with 9 additions and 8 deletions
|
|
@ -321,19 +321,20 @@ int slipstream_client_sockloop_callback(picoquic_quic_t* quic, picoquic_packet_l
|
|||
|
||||
switch (cb_mode) {
|
||||
case picoquic_packet_loop_before_select:
|
||||
picoquic_cnx_t* cnx = client_ctx->cnx;
|
||||
picoquic_path_t* path_x = cnx->path[0];
|
||||
picoquic_connection_id_t outgoing_dest_connection_id = path_x->p_remote_cnxid->cnx_id;
|
||||
if (outgoing_dest_connection_id.id_len == 0) {
|
||||
outgoing_dest_connection_id = cnx->initial_cnxid;
|
||||
}
|
||||
|
||||
uint64_t current_time = picoquic_current_time();
|
||||
uint64_t passed = current_time - client_ctx->last_request;
|
||||
if (passed < 20000) {
|
||||
break;
|
||||
}
|
||||
|
||||
const picoquic_cnx_t* cnx = client_ctx->cnx;
|
||||
const int path_index = rand() % cnx->nb_paths;
|
||||
const picoquic_path_t* path_x = cnx->path[path_index];
|
||||
picoquic_connection_id_t outgoing_dest_connection_id = path_x->p_remote_cnxid->cnx_id;
|
||||
if (outgoing_dest_connection_id.id_len == 0) {
|
||||
outgoing_dest_connection_id = cnx->initial_cnxid;
|
||||
}
|
||||
|
||||
|
||||
uint8_t* poll_packet_buf;
|
||||
size_t poll_packet_len;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ int slipstream_packet_loop_(picoquic_network_thread_ctx_t* thread_ctx, picoquic_
|
|||
picoquic_packet_loop_param_t* param = thread_ctx->param;
|
||||
const picoquic_packet_loop_cb_fn loop_callback = thread_ctx->loop_callback;
|
||||
void* loop_callback_ctx = thread_ctx->loop_callback_ctx;
|
||||
slot_t slots[PICOQUIC_PACKET_LOOP_RECV_MAX];
|
||||
slot_t slots[PICOQUIC_PACKET_LOOP_RECV_MAX] = {0};
|
||||
|
||||
while (!thread_ctx->thread_should_close) {
|
||||
if (loop_callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue