提交 aa13cb0a authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Update NPM deps and usrsctp

上级 a5880a52
......@@ -47,7 +47,7 @@
"testRegex": "test/test.*\\.js"
},
"dependencies": {
"@types/node": "^14.14.28",
"@types/node": "^14.14.33",
"awaitqueue": "^2.3.3",
"debug": "^4.3.1",
"h264-profile-level-id": "^1.0.1",
......@@ -60,11 +60,11 @@
"@types/debug": "^4.1.5",
"@types/random-number": "0.0.0",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"cross-env": "^7.0.3",
"eslint": "^7.20.0",
"eslint-plugin-jest": "^24.1.3",
"eslint": "^7.21.0",
"eslint-plugin-jest": "^24.2.0",
"gulp": "^4.0.2",
"gulp-clang-format": "^1.0.27",
"jest": "^26.6.3",
......
......@@ -34,7 +34,7 @@
#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 366483 2020-10-06 11:29:08Z tuexen $");
__FBSDID("$FreeBSD$");
#endif
#include <netinet/sctp_os.h>
......@@ -5181,6 +5181,10 @@ out:
/* Clear net */
asoc->last_control_chunk_from = NULL;
}
if (net == asoc->last_net_cmt_send_started) {
/* Clear net */
asoc->last_net_cmt_send_started = NULL;
}
if (net == stcb->asoc.alternate) {
sctp_free_remote_addr(stcb->asoc.alternate);
stcb->asoc.alternate = NULL;
......
......@@ -34,7 +34,7 @@
#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_timer.c 365071 2020-09-01 21:19:14Z mjg $");
__FBSDID("$FreeBSD$");
#endif
#define _IP_VHL
......@@ -171,8 +171,8 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
/*
* sctp_find_alternate_net() returns a non-NULL pointer as long
* the argument net is non-NULL.
* sctp_find_alternate_net() returns a non-NULL pointer as long as there
* exists nets, which are not being deleted.
*/
struct sctp_nets *
sctp_find_alternate_net(struct sctp_tcb *stcb,
......@@ -181,13 +181,13 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
{
/* Find and return an alternate network if possible */
struct sctp_nets *alt, *mnet, *min_errors_net = NULL , *max_cwnd_net = NULL;
int once;
bool looped;
/* JRS 5/14/07 - Initialize min_errors to an impossible value. */
int min_errors = -1;
uint32_t max_cwnd = 0;
if (stcb->asoc.numnets == 1) {
/* No others but net */
/* No selection can be made. */
return (TAILQ_FIRST(&stcb->asoc.nets));
}
/*
......@@ -323,25 +323,22 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
return (max_cwnd_net);
}
}
mnet = net;
once = 0;
if (mnet == NULL) {
mnet = TAILQ_FIRST(&stcb->asoc.nets);
if (mnet == NULL) {
return (NULL);
}
/* Look for an alternate net, which is active. */
if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) {
alt = TAILQ_NEXT(net, sctp_next);;
} else {
alt = TAILQ_FIRST(&stcb->asoc.nets);
}
looped = false;
for (;;) {
alt = TAILQ_NEXT(mnet, sctp_next);
if (alt == NULL) {
once++;
if (once > 1) {
break;
if (!looped) {
alt = TAILQ_FIRST(&stcb->asoc.nets);
looped = true;
}
alt = TAILQ_FIRST(&stcb->asoc.nets);
/* Definitely out of candidates. */
if (alt == NULL) {
return (NULL);
break;
}
}
#if defined(__FreeBSD__) && !defined(__Userspace__)
......@@ -361,43 +358,56 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
#else
(alt->ro.ro_rt != NULL) &&
#endif
(!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) {
/* Found a reachable address */
(!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) &&
(alt != net)) {
/* Found an alternate net, which is reachable. */
break;
}
mnet = alt;
alt = TAILQ_NEXT(alt, sctp_next);
}
if (alt == NULL) {
/* Case where NO insv network exists (dormant state) */
/* we rotate destinations */
once = 0;
mnet = net;
/*
* In case no active alternate net has been found, look for
* an alternate net, which is confirmed.
*/
if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) {
alt = TAILQ_NEXT(net, sctp_next);;
} else {
alt = TAILQ_FIRST(&stcb->asoc.nets);
}
looped = false;
for (;;) {
if (mnet == NULL) {
return (TAILQ_FIRST(&stcb->asoc.nets));
}
alt = TAILQ_NEXT(mnet, sctp_next);
if (alt == NULL) {
once++;
if (once > 1) {
break;
if (!looped) {
alt = TAILQ_FIRST(&stcb->asoc.nets);
looped = true;
}
alt = TAILQ_FIRST(&stcb->asoc.nets);
/* Definitely out of candidates. */
if (alt == NULL) {
break;
}
}
if ((!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) &&
(alt != net)) {
/* Found an alternate address */
/* Found an alternate net, which is confirmed. */
break;
}
mnet = alt;
alt = TAILQ_NEXT(alt, sctp_next);
}
}
if (alt == NULL) {
return (net);
/*
* In case no confirmed alternate net has been found, just
* return net, if it is not being deleted. In the other case
* just return the first net.
*/
if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) {
alt = net;
}
if (alt == NULL) {
alt = TAILQ_FIRST(&stcb->asoc.nets);
}
}
return (alt);
}
......
......@@ -2383,14 +2383,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
rndval = sctp_select_initial_TSN(&inp->sctp_ep);
jitter = rndval % to_ticks;
if (jitter >= (to_ticks >> 1)) {
to_ticks = to_ticks + (jitter - (to_ticks >> 1));
to_ticks >>= 1;
if (jitter < (UINT32_MAX - to_ticks)) {
to_ticks += jitter;
} else {
to_ticks = to_ticks - jitter;
to_ticks = UINT32_MAX;
}
if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) &&
!(net->dest_state & SCTP_ADDR_PF)) {
to_ticks += net->heart_beat_delay;
if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) {
to_ticks += net->heart_beat_delay;
} else {
to_ticks = UINT32_MAX;
}
}
/*
* Now we must convert the to_ticks that are now in
......
......@@ -626,7 +626,7 @@ namespace RTC
// Reset jitter.
this->transit = 0;
this->jitter = 0;
this->jitter = 0;
}
void RtpStreamRecv::Resume()
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论