Skip to content

Commit

Permalink
[core] Fixed post-action for socket options
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Feb 19, 2021
1 parent 1c7da11 commit 21058d5
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,32 +329,26 @@ void CUDT::setOpt(SRT_SOCKOPT optName, const void* optval, int optlen)
}

// Post-action, if applicable
if (IsSet(oflags, SRTO_POST_SPEC))
if (IsSet(oflags, SRTO_POST_SPEC) && m_bConnected)
{
if (m_bConnected)
if (m_bOpened)
throw CUDTException(MJ_NOTSUP, MN_ISBOUND, 0);

switch (optName)
{
switch (optName)
{
case SRTO_MAXBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_RESET));
break;
case SRTO_MAXBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_RESET));
break;

case SRTO_INPUTBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_INPUTBW));
break;
case SRTO_INPUTBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_INPUTBW));
break;

case SRTO_OHEADBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_OHEADBW));
break;
case SRTO_OHEADBW:
updateCC(TEV_INIT, EventVariant(TEV_INIT_OHEADBW));
break;

case SRTO_LOSSMAXTTL:
m_iReorderTolerance = m_config.m_iMaxReorderTolerance;
case SRTO_LOSSMAXTTL:
m_iReorderTolerance = m_config.m_iMaxReorderTolerance;

default: break;
}
default: break;
}
}
}
Expand Down

0 comments on commit 21058d5

Please sign in to comment.