Skip to content

Commit

Permalink
[API] Set up length limits for STREAMID and PACKETFILTER in the API
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj Malecki committed Jan 9, 2025
1 parent 8a89a3a commit 89d008a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions srtcore/socketconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ written by
#include <linux/if.h>
#endif
#include <string>
#include "srt.h"
#include "haicrypt.h"
#include "congctl.h"
#include "packet.h"
Expand Down Expand Up @@ -212,8 +213,8 @@ struct CSrtConfig: CSrtMuxerConfig

// Mimimum recv flight flag size is 32 packets
static const int DEF_MIN_FLIGHT_PKT = 32;
static const size_t MAX_SID_LENGTH = 512;
static const size_t MAX_PFILTER_LENGTH = 64;
static const size_t MAX_SID_LENGTH = SRT_STREAMID_MAX;
static const size_t MAX_PFILTER_LENGTH = SRT_PACKETFILTER_MAX;
static const size_t MAX_CONG_LENGTH = 16;

int iMSS; // Maximum Segment Size, in bytes
Expand Down
6 changes: 6 additions & 0 deletions srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ static const int SRT_LIVE_MAX_PLSIZE = 1456; // MTU(1500) - UDP.hdr(28) - SRT.hd
// Latency for Live transmission: default is 120
static const int SRT_LIVE_DEF_LATENCY_MS = 120;

// Maximum number of characters for SRTO_STREAMID
static const size_t SRT_STREAMID_MAX = 512;

// Maximum number of characters for packet filter configuration, SRTO_PACKETFILTER
static const size_t SRT_PACKETFILTER_MAX = 64;

// Importrant note: please add new fields to this structure to the end and don't remove any existing fields
struct CBytePerfMon
{
Expand Down

0 comments on commit 89d008a

Please sign in to comment.