Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Feb 5, 2024
1 parent f2f04d8 commit 3b40847
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 70 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ jobs:
test:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
#android-arch: ["arm64-v8a", "x86_64"]
android-arch: ["x86_64"]
android-api-level: [29, 33]
android-ndk-version: ["26.0.10792818"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Go Toolchain
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '=1.20.0'

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ jobs:
static-analysis:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
]
toolchain: [
stable,
1.71.1
1.75.0
]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Go Toolchain
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '=1.20.0'

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
Expand All @@ -25,10 +26,10 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Go Toolchain
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '=1.20.0'

Expand Down
22 changes: 0 additions & 22 deletions crates/tx5-go-pion/src/data_chan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,6 @@ macro_rules! data_chan_weak_core {
}

impl WeakDataChan {
/*
pub fn close(&self, err: Error) {
if let Some(strong) = self.0.upgrade() {
let mut tmp = Err(err.clone());
{
let mut lock = strong.lock().unwrap();
let mut do_swap = false;
if let Ok(core) = &mut *lock {
core.close(err);
do_swap = true;
}
if do_swap {
std::mem::swap(&mut *lock, &mut tmp);
}
}
// make sure the above lock is released before this is dropped
drop(tmp);
}
}
*/
pub fn send_evt(&self, evt: DataChannelEvent) -> Result<()> {
data_chan_weak_core!(self.0, core, {
core.evt_send
Expand Down
10 changes: 0 additions & 10 deletions crates/tx5-go-pion/src/evt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,27 +142,18 @@ impl Manager {

trait Wk<E> {
fn se(&self, evt: E) -> Result<()>;
//fn cl(&self, err: Error);
}

impl Wk<PeerConnectionEvent> for peer_con::WeakPeerCon {
fn se(&self, evt: PeerConnectionEvent) -> Result<()> {
self.send_evt(evt)
}

//fn cl(&self, err: Error) {
// self.close(err);
//}
}

impl Wk<DataChannelEvent> for data_chan::WeakDataChan {
fn se(&self, evt: DataChannelEvent) -> Result<()> {
self.send_evt(evt)
}

//fn cl(&self, err: Error) {
// self.close(err);
//}
}

fn smap<E, W: Wk<E>>(
Expand All @@ -174,7 +165,6 @@ impl Manager {
map.entry(id)
{
if o.get().se(evt).is_err() {
//o.get().cl(Error::id("EventSendError").into());
o.remove();
}
}
Expand Down
22 changes: 0 additions & 22 deletions crates/tx5-go-pion/src/peer_con.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,28 +153,6 @@ macro_rules! peer_con_weak_core {
}

impl WeakPeerCon {
/*
pub fn close(&self, err: Error) {
if let Some(strong) = self.0.upgrade() {
let mut tmp = Err(err.clone());
{
let mut lock = strong.lock().unwrap();
let mut do_swap = false;
if let Ok(core) = &mut *lock {
core.close(err.clone());
do_swap = true;
}
if do_swap {
std::mem::swap(&mut *lock, &mut tmp);
}
}
// make sure the above lock is released before this is dropped
drop(tmp);
}
}
*/
pub fn send_evt(&self, evt: PeerConnectionEvent) -> Result<()> {
peer_con_weak_core!(self.0, core, {
core.evt_send
Expand Down
3 changes: 0 additions & 3 deletions crates/tx5/src/ep3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ pub enum Ep3Event {

/// Message sent by the remote peer.
message: Vec<u8>,

/// Permit counting the bytes allowed in memory on the receive side.
permit: tokio::sync::OwnedSemaphorePermit,
},
}

Expand Down
6 changes: 0 additions & 6 deletions crates/tx5/src/ep3/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,6 @@ impl Peer {
.send(Ep3Event::Message {
peer_url: peer_url.clone(),
message,
// TODO - fixme
permit: Arc::new(
tokio::sync::Semaphore::new(1),
)
.try_acquire_owned()
.unwrap(),
})
.await
.is_err()
Expand Down

0 comments on commit 3b40847

Please sign in to comment.