Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fixed the use of the right error constant #2595

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2424c99
Fixing implicit integer and wrong use of SRT_ERROR and SRT_INVALID_SO…
Dec 22, 2022
6ad1041
[MAINT] Fixed example buildbreaks. Added examples for message mode tr…
ethouris Dec 22, 2022
340f0b5
Updated
ethouris Dec 22, 2022
29e8c19
Fixed wrong assertion for drop snd buf sequence check
Dec 23, 2022
31b3a78
Updated
Dec 23, 2022
ce98b8a
[MAINT] Refax for CSndBuffer::readData to make the call form clearer
Dec 23, 2022
333eaf2
[MAINT] Removed reference fields from CPacket pinned to the SRT header
Dec 23, 2022
43c0883
Updated and fixed
Dec 23, 2022
6e2280d
Updated with the fixes
Dec 23, 2022
512e548
Merge branch 'master' into dev-fix-implicit-int
Jan 11, 2023
08d1e5c
Minor fixes
Jan 11, 2023
4888873
Merge branch 'master' into dev-refax-readdata-rexmit
Jan 11, 2023
dba39ef
Merge branch 'master' into dev-refax-readdata-rexmit
Jan 24, 2023
addefb3
Merge branch 'master' into dev-fix-implicit-int
Jan 25, 2023
03c19ac
Merge branch 'master' into dev-refax-readdata-rexmit
Feb 20, 2023
b0e681f
Updated and fixed
Feb 20, 2023
3781775
Merge branch 'master' into dev-refax-readdata-rexmit
May 4, 2023
d126e64
Merge branch 'master' into dev-refax-remove-cpacket-refs
May 8, 2023
380e12f
Updated to latest upstream through #2594
May 8, 2023
88b9f33
Fixed build break on Android
May 10, 2023
084c9c5
Merge branch 'master' into dev-refax-remove-cpacket-refs
Sep 14, 2023
185276c
Merged and fixed
Sep 14, 2023
200e3c5
Updated and fixed
Oct 9, 2023
1ffde27
Merge branch 'master' into dev-refax-readdata-rexmit
Oct 10, 2023
58fbf27
Updated and fixed
Oct 10, 2023
a0de6ff
Merge branch 'dev-refax-remove-cpacket-refs' into dev-fix-implicit-int
Oct 10, 2023
920969b
Synchronized and improved
Oct 10, 2023
7a4e00c
Fixed clang warnings (build break on some CI)
Oct 10, 2023
8c0102a
Updated and fixed
Feb 19, 2024
d28e3b2
Introduced SRTRUNSTATUS to cover all cases of srt_startup(). Fixed do…
Feb 19, 2024
be302ca
Removed srt::isgroup. Reused CUDT::isgroup where applicable. Added mi…
Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/socketoptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct SocketOption
template<>
inline int SocketOption::setso<SocketOption::SRT, int>(int socket, int /*ignored*/, int sym, const void* data, size_t size)
{
return srt_setsockopt(socket, 0, SRT_SOCKOPT(sym), data, (int) size);
return (int)srt_setsockopt(SRTSOCKET(socket), 0, SRT_SOCKOPT(sym), data, (int) size);
}

#if ENABLE_BONDING
Expand Down
74 changes: 74 additions & 0 deletions common/devel_util.h
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the difference with utilities.h?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file contains things that are in any temporary use for development. This is only provided for convenience for the use during development, but the normal code goes with this file ousted, with provided just plain definitions for the specific types as alias to integer.

Directly this file is provided so that by a temporary change in srt.h you can run the compile command and then by the errors you get you can find out where the rules for the right usage of the status types has been violated.

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

template<class INT, int ambg>
struct IntWrapper
{
INT v;

IntWrapper() {}
explicit IntWrapper(INT val): v(val) {}

bool operator==(const IntWrapper& x) const
{
return v == x.v;
}

bool operator!=(const IntWrapper& x) const
{
return !(*this == x);
}

explicit operator INT() const
{
return v;
}

template<class I, class T>
friend T& operator<<(T& out, const IntWrapper<I, ambg>& x)
{
out << x.v;
return out;
}

bool operator<(const IntWrapper& w) const
{
return v < w.v;
}
};

template<class INT, int ambg>
struct IntWrapperLoose: IntWrapper<INT, ambg>
{
typedef IntWrapper<INT, ambg> base_t;
explicit IntWrapperLoose(INT val): base_t(val) {}

bool operator==(const IntWrapper<INT, ambg>& x) const
{
return this->v == x.v;
}

friend bool operator==(const IntWrapper<INT, ambg>& x, const IntWrapperLoose& y)
{
return x.v == y.v;
}

bool operator==(INT val) const
{
return this->v == val;
}

friend bool operator==(INT val, const IntWrapperLoose<INT, ambg>& x)
{
return val == x.v;
}

operator INT() const
{
return this->v;
}
};


//typedef IntWrapper<int32_t, 0> SRTSOCKET;
//typedef IntWrapper<int, 1> SRTSTATUS;
//typedef IntWrapperLoose<int, 1> SRTSTATUS_LOOSE;

2 changes: 1 addition & 1 deletion examples/sendmsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main(int argc, char* argv[])
// 2. Otherwise the first number is the ID, followed by a space, to be filled in first 4 bytes.
// 3. Rest of the characters, up to the end of line, should be put into a solid block and sent at once.

int status = 0;
int status = SRT_STATUS_OK;

int ordinal = 1;
int lpos = 0;
Expand Down
Loading