Commit Graph
852 Commits
Author SHA1 Message Date
Fletcher Dunn 645aa5df6b Compile fixes from Steam.
(NOP for this code.)

P4:6127531, 6127534
2020-10-06 15:54:54 -07:00
Fletcher Dunn dec216ef22 Move STEAMNETWORKINGSOCKETS_DECLARE_CLASS_OPERATOR_NEW 2020-09-30 18:20:10 -07:00
Steven Noonan c368aa1f50 travis: add test to build LTO binaries
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-30 18:03:04 -07:00
Steven Noonan 8348e9234a CMake: add support for LTO/LTCG/IPO/whatever-its-called-these-days
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-30 16:26:07 -07:00
Fletcher Dunn 39172666ce Prune webrtc dependencies.
The webrtc code is actually really well organized, with a layered approach.
We are accessing the code at alow level, and we really don't need any of
the higher levels.  If function-level linking is used, this problem
would already be solved and we really wouldn't need to do any work.

Unfortunately, right now webrtc_sdp.cc is a file that straddles layers.
The *functions* themselves are actually layered just fine.  But they are
in the same source file, and so when file-level linking is used, you cannot
use only the low level ICE-related functions.  You end up bringing in the
full SDP parsing and printing functions, which means you have to know about
media types, and codecs, etc.  I think the best way to cut this Gordian
knot is to....um...cut it.  See the hacked file for more info.

Right now we are not using DTLS, and so we still have some extra stuff in
the lib that could be removed.  But I'm not inclined to make those cuts right
now, because in the future we may want to use their DTLS code.  In fact,
we may end up needing to put some of this stuff back, if we want to use
RTP data channels, perhaps for compatibility with the browser.
2020-09-30 15:12:00 -07:00
Fletcher Dunn c7d9d3beff Prune webrtc dependencies.
We don't need the event logging, which brought in protobuf dependencies
and task queues and a bunch of other stuff.
2020-09-30 14:07:28 -07:00
Fletcher Dunn c9220b5438 Fix include path 2020-09-30 13:20:48 -07:00
Fletcher Dunn 6c299890ea Delete Error() #define.
This function (which performs a FATAL PROGRAM TERMINATION) is really
poorly named and something I don't like about Source/Steam codebase.
But #defining it was even worse.  It's currently brekaing protobuf.
2020-09-30 11:48:39 -07:00
Fletcher Dunn 9d1684c26c Use AssertFatalMsg instead of Error() 2020-09-30 11:48:17 -07:00
Fletcher Dunn 10e7cd2491 Rename "spew" -> "DebugOutput" in API surface. 2020-09-30 11:44:31 -07:00
Fletcher Dunn 54fbbbfd7f Add SetPreFormatSpewHandler hook. 2020-09-30 11:33:07 -07:00
Fletcher Dunn b9354f6c9f Assert/spew cleanup
Rewrite assert.  Previous version was a hacked version from Steam, but there
was too much plumbing, and we have a partner who wants to hook callback so
they get spew before formatting happens.  So that means it cannot be done at
the call site.
2020-09-30 11:05:33 -07:00
Fletcher Dunn 1108fadc92 Sync with Steam version.
NOP for the opensource code, I just got tired of having differences exist
between the two versions.
2020-09-29 10:41:24 -07:00
Fletcher Dunn 78efe77250 Fix MSVC release tests 2020-09-29 10:22:14 -07:00
Fletcher Dunn 89f81fa249 Added mechanism for custom memory allocator.
I let certain allocations go thorugh the CRT on purpose.  Specifically,
allocations that happen at static init time must go through.  Unfortunately,
MSVC's std::vector and std::map default constructors will allocate memory (!!!!)
with _ITERATOR_DEBUG_LEVEL > 0, so any such object at file scope will, for
now at least, not use the custom allocators.
2020-09-25 17:09:29 -07:00
Steven Noonan 133f0db27d examples: don't build signaling server example if go binary is absent
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-18 07:24:42 -07:00
Fletcher Dunn 315228d0fc Always use STEAMWEBRTC_USE_STATIC_LIBS.
Remove it as an option.  This breaks the "install" steps.  I need help fixing them.
2020-09-14 18:41:20 -07:00
Fletcher Dunn c98bf92eba Only build P2P tests if USE_STEAMWEBRTC 2020-09-14 18:40:26 -07:00
Fletcher Dunn b29911db5b Don't build example P2P server unless USE_STEAMWEBRTC.
Fixes issue #139
2020-09-14 18:03:19 -07:00
Steven Noonan 0a5c0448d4 travis/build-cmake: print summary of environment before building
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 13:20:49 -07:00
Steven Noonan 8e25db7859 travis/build-cmake: make directory cleanup simpler
We want to keep track of what build directories we make and clean them
up, but hardcoding the list is kind of annoying as we add new build
configurations.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 13:20:49 -07:00
Steven Noonan c7a838d8e3 travis: shellcheck cleanups
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 13:20:48 -07:00
Steven Noonan 18c7e3b917 travis-run-local: use aptman/qus instead of multiarch/qemu-user-static
It has more portability because it supports more than just x86_64 host
systems.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2020-09-04 01:56:26 -07:00
Steven Noonan c3d0157413 travis: add i386 Debian test target
To ensure we don't break 32-bit builds.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 01:47:51 -07:00
Steven Noonan aa9a267e7d CMake: ensure -msse2 flag is added for all x86 builds
i686 doesn't have it enabled by default, but we need it for our
reference implementation of ed25519/curve25519.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 01:47:51 -07:00
Steven Noonan 17d58084d7 travis: disable sanitizers for Clang on i686
Trying to run an i386 Ubuntu container results in linker errors for the
sanitizer builds.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 01:34:28 -07:00
Steven Noonan c904b94d3d travis: expand ppc64 exclusion for WebRTC variant
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-04 00:50:13 -07:00
Steven Noonan cfbb99db03 travis: symlink install-debian -> install-ubuntu
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 18:15:18 -07:00
Steven Noonan c1cd16a3d4 travis: add "apt-get dist-upgrade" to install-ubuntu
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 18:14:45 -07:00
Steven Noonan dd08766a42 travis: do "dnf update" in install-fedora
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 18:14:09 -07:00
Steven Noonan d81d2f2203 travis: add install-opensuse script
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 18:14:01 -07:00
Steven Noonan 2afd8efa9d travis: add generic install.sh to find image-appropriate script
Makes it easier to add images with weird characters in them, e.g.
"opensuse/tumbleweed:latest" would end up giving the wrong path with the
old config.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 18:04:41 -07:00
Steven Noonan dde5e7a48d travis: work around fedora:rawhide build problem
It seems the rawhide compile/link issue is specifically a combination of
clang + sanitizers. Disabling those seems to make it behave.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 17:47:12 -07:00
Steven Noonan 6ce321d048 travis-run-local: allow specifying arch+image+tag not present in config
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 17:47:12 -07:00
Fletcher Dunn 5fe10494e2 Tweak windows build instructions v1.2.0 2020-09-03 17:02:59 -07:00
Steven Noonan 1e0a211d2e CMakeLists: indent push/pop check state blocks, NFC
For readability.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 16:31:05 -07:00
Fletcher Dunn 1d11919760 Disable some warnings in tests/examples.
Refactored a bunch of common stuff into a function to do this
2020-09-03 16:29:37 -07:00
Steven Noonan 3fe367ee7e editorconfig: add specification for Python
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 15:34:27 -07:00
Steven Noonan e6a91dae1c crypto: normalize indentation via editorconfig, NFC
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 15:31:48 -07:00
Steven Noonan 0eedd618eb CMakeLists: normalize indentation to editorconfig, NFC
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 15:31:44 -07:00
Steven Noonan 4709ced571 editorconfig: added to repository
We've got a bunch of inconsistent tabs/spaces for indentation, let's try
to normalize that.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 15:26:17 -07:00
Fletcher Dunn bea84e2844 Check if output buffer is too small.
It really seems like libsodium (whose entire purpose is to make crypto
idiot-proof) making me mess with these details is a flaw in the API design.

Also, correct Hungarian.
2020-09-03 15:05:55 -07:00
Fletcher Dunn d885e72b43 Wrap long lines
(No functional change yet.)
2020-09-03 14:56:17 -07:00
Fletcher Dunn 4a2672292a Tweak comments in header.
This syncs up with the headers in the Steamworks SDK.
2020-09-03 12:01:59 -07:00
Fletcher Dunn 56092ec7e7 Fix compiler warning 2020-09-03 11:58:27 -07:00
Fletcher Dunn d944a10808 Tweak pointer math to avoid possible integer overflow 2020-09-03 11:24:25 -07:00
Fletcher Dunn e0c86dcb91 Drop unreliable segments with weird offset/size.
And be more deliberate about limits of unreliable message/segment sizes.
2020-09-03 11:01:54 -07:00
Fletcher Dunn e950c994de Don't try to handle a weird situation.
We were trying to be smart and handle a sender sending us unreliable
segments starting at the same offset.  Handling this weird situation
is not worth the complexity.
2020-09-03 10:49:12 -07:00
Fletcher Dunn 559c649786 Move constants to header
No functional change here.  Intended to make the next change easier to parse.
2020-09-03 10:46:57 -07:00
Steven Noonan 2229c676b9 steamwebrtc: don't attempt to build on big endian architectures
We know for certain the stock arch.h file for WebRTC doesn't know about
those, which also means it's untested with them.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
2020-09-03 07:40:23 -07:00