Skip to content

Commit

Permalink
[~] skip priority if fec not compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylsy committed Oct 28, 2024
1 parent a2958b4 commit 0581bd8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
openssl req -newkey rsa:2048 -x509 -nodes -keyout "$keyfile" -new -out "$certfile" -subj /CN=test.xquic.com
./tests/run_tests | tee -a ../xquic_test.log
../scripts/case_test.sh | tee -a ../xquic_test.log
gcovr -r .. --xml --gcov-ignore-parse-errors=negative_hits.warn -o ../coverage.xml
gcovr -r .. --xml --gcov-ignore-parse-errors -o ../coverage.xml
- name: Check Test Result
run: |
Expand Down
11 changes: 5 additions & 6 deletions scripts/case_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4412,12 +4412,11 @@ else
case_print_result "h3_engine_set_settings_api_h3_ext_more" "fail"
fi

sudo rm -rf tp_localhost test_session xqc_token clog slog
sudo rm -rf tp_localhost test_session xqc_token clog slog stdlog
killall test_server 2> /dev/null
${SERVER_BIN} -l d -e -f > /dev/null &
sleep 1

rm -rf tp_localhost test_session xqc_token
echo -e "negotiate_encoder_fec_schemes ...\c"
${CLIENT_BIN} -l d -g >> stdlog
clog_res1=`grep "|xqc_negotiate_fec_schemes|set final encoder fec scheme: XOR" clog`
Expand All @@ -4432,7 +4431,7 @@ else
fi


rm -rf tp_localhost test_session xqc_token
sudo rm -rf tp_localhost test_session xqc_token stdlog
echo -e "negotiate_decoder_fec_schemes ...\c"
${CLIENT_BIN} -l d -g >> stdlog
clog_res2=`grep "|xqc_negotiate_fec_schemes|set final decoder fec scheme: XOR" clog`
Expand All @@ -4452,7 +4451,7 @@ killall test_server 2> /dev/null
${SERVER_BIN} -l d -e -f -x 1 -M > /dev/null &
sleep 1

rm -rf tp_localhost test_session xqc_token
sudo rm -rf tp_localhost test_session xqc_token stdlog
echo -e "check fec recovery function of stream using XOR ...\c"
${CLIENT_BIN} -s 5120000 -l e -E -d 30 -g -M -i lo -i lo >> stdlog
slog_res1=`grep '|process packet of block .\{1,3\} successfully' slog`
Expand All @@ -4466,7 +4465,7 @@ else
fi

clear_log
rm -rf tp_localhost test_session xqc_token
sudo rm -rf tp_localhost test_session xqc_token stdlog
echo -e "check fec recovery function of stream using RSC ...\c"
${CLIENT_BIN} -s 5120000 -l e -E -d 30 -g -M -i lo -i lo --fec_encoder 8 --fec_decoder 8 >> stdlog
slog_res1=`grep '|process packet of block .\{1,3\} successfully' slog`
Expand All @@ -4480,7 +4479,7 @@ else
fi

clear_log
rm -rf tp_localhost test_session xqc_token
sudo rm -rf tp_localhost test_session xqc_token stdlog
echo -e "check fec recovery function of stream using PM ...\c"
${CLIENT_BIN} -s 5120000 -l e -E -d 30 -g -M -i lo -i lo --fec_encoder 12 --fec_decoder 12 >> stdlog
slog_res1=`grep '|process packet of block .\{1,3\} successfully' slog`
Expand Down
4 changes: 2 additions & 2 deletions src/http3/xqc_h3_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,12 @@ xqc_write_http_priority(xqc_h3_priority_t *prio,
xqc_memcpy(dst, XQC_PRIORITY_REINJECT, XQC_PRIORITY_REINJECT_LEN);
dst += XQC_PRIORITY_REINJECT_LEN;
*dst++ = '0' + prio->reinject;

#ifdef XQC_ENABLE_FEC
xqc_memcpy(dst, XQC_PRIORITY_FEC, XQC_PRIORITY_FEC_LEN);
dst += XQC_PRIORITY_FEC_LEN;
xqc_memcpy(dst, &prio->fec, 4);
dst += 4;

#endif
return dst - begin;
}

Expand Down
9 changes: 6 additions & 3 deletions src/http3/xqc_h3_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@ xqc_h3_stream_get_path_info(xqc_h3_stream_t *h3s)
}
}
}

#ifdef XQC_ENABLE_FEC
uint8_t
xqc_set_stream_fec_block_mode(uint32_t fec_size)
{
Expand All @@ -2097,7 +2097,7 @@ xqc_set_stream_fec_block_mode(uint32_t fec_size)
return XQC_LARGE_SIZE_REQ;
}
}

#endif
void
xqc_h3_stream_set_priority(xqc_h3_stream_t *h3s, xqc_h3_priority_t *prio)
{
Expand All @@ -2108,15 +2108,18 @@ xqc_h3_stream_set_priority(xqc_h3_stream_t *h3s, xqc_h3_priority_t *prio)
h3s->priority.incremental = prio->incremental;
h3s->priority.schedule = prio->schedule;
h3s->priority.reinject = prio->reinject;
#ifdef XQC_ENABLE_FEC
h3s->priority.fec = prio->fec;

#endif
if (h3s->stream == NULL) {
xqc_log(h3s->log, XQC_LOG_ERROR, "|transport stream was NULL|stream_id:%ui|", h3s->stream_id);
return;
}

xqc_stream_set_multipath_usage(h3s->stream, h3s->priority.schedule, h3s->priority.reinject);
#ifdef XQC_ENABLE_FEC
h3s->stream->stream_fec_blk_mode = xqc_set_stream_fec_block_mode(h3s->priority.fec);
h3s->h3r->block_size_mode = h3s->stream->stream_fec_blk_mode;
#endif
}
}

0 comments on commit 0581bd8

Please sign in to comment.