Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
aarani committed Oct 28, 2023
1 parent 4aac077 commit 7978b5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NOnion.Tests/HiddenServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace NOnion.Tests
{
public class HiddenServicesTests
{
[SetUp]
[OneTimeSetUp]
public void Init()
{
cachePath =
Expand Down
19 changes: 17 additions & 2 deletions NOnion/Client/TorClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ type TorClient internal (directory: TorDirectory) =

member __.Directory = directory

member __.AsyncCreateCircuit
member internal __.AsyncCreateCircuitWithCallback
(hopsCount: int)
(purpose: CircuitPurpose)
(extendByNodeOpt: Option<CircuitNodeDetail>)
(serviceStream: uint16 -> TorCircuit -> Async<unit>)
=
async {
let rec createNewGuard() =
Expand Down Expand Up @@ -160,7 +161,7 @@ type TorClient internal (directory: TorDirectory) =
else
try
let! guard, guardDetail = createNewGuard()
let circuit = TorCircuit guard
let circuit = TorCircuit(guard, serviceStream)

do!
circuit.Create guardDetail
Expand Down Expand Up @@ -245,6 +246,20 @@ type TorClient internal (directory: TorDirectory) =
return! tryCreateCircuit startTryNumber
}

member self.AsyncCreateCircuit
(hopsCount: int)
(purpose: CircuitPurpose)
(extendByNodeOpt: Option<CircuitNodeDetail>)
=
let noop _ _ =
async { return () }

self.AsyncCreateCircuitWithCallback
hopsCount
purpose
extendByNodeOpt
noop

member self.CreateCircuitAsync
(
hopsCount: int,
Expand Down
3 changes: 2 additions & 1 deletion NOnion/Services/TorServiceHost.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ type TorServiceHost
)

let! rendezvousCircuit =
client.AsyncCreateCircuit
client.AsyncCreateCircuitWithCallback
2
CircuitPurpose.Unknown
(Some lastNodeDetails)
self.IncomingServiceStreamCallback

do!
rendezvousCircuit.Rendezvous
Expand Down

0 comments on commit 7978b5e

Please sign in to comment.