Skip to content

Commit

Permalink
[core] Fixed POST options setting on a connected group.
Browse files Browse the repository at this point in the history
The list of options was unordered, hence the binary search failed to find those options.
  • Loading branch information
maxsharabayko committed Feb 22, 2024
1 parent 6b75145 commit b2d48bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const int UDT::ERROR = srt::CUDT::ERROR;
2[15..0]: TsbPD delay [0..60000] msec
*/

// IMPORTANT!!! This array must be ordered by value, because std::binary_search is performed on it!
extern const SRT_SOCKOPT srt_post_opt_list [SRT_SOCKOPT_NPOST] = {
SRTO_SNDSYN,
SRTO_RCVSYN,
Expand All @@ -127,11 +128,14 @@ extern const SRT_SOCKOPT srt_post_opt_list [SRT_SOCKOPT_NPOST] = {
SRTO_RCVTIMEO,
SRTO_MAXBW,
SRTO_INPUTBW,
SRTO_MININPUTBW,
SRTO_OHEADBW,
SRTO_SNDDROPDELAY,
SRTO_DRIFTTRACER,
SRTO_MININPUTBW,
SRTO_LOSSMAXTTL
#ifdef ENABLE_MAXREXMITBW
,SRTO_MAXREXMITBW
#endif
};

const int32_t
Expand Down

4 comments on commit b2d48bd

@marakew
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D:\git\srt\srtcore\core.cpp(137): error C2078: too many initializers

counts limited by SRT_SOCKOPT_NPOST

@maxsharabayko
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marakew Argh, missed that.
Addressed in PR #2890. Thanks!

@marakew
Copy link

@marakew marakew commented on b2d48bd Feb 22, 2024 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethouris
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but this symbol is there for a reason. It should just catch cases like the one you reported that are signs of problems.

Please sign in to comment.