Skip to content

Commit

Permalink
Merge pull request #43 from aarani/wip/noSemaphore
Browse files Browse the repository at this point in the history
Network,Utility: remove usage of SemaphoreLocker
  • Loading branch information
knocte authored Oct 21, 2022
2 parents 51bdb10 + 098a925 commit eedb0a8
Show file tree
Hide file tree
Showing 10 changed files with 1,514 additions and 1,063 deletions.
3 changes: 3 additions & 0 deletions NOnion/Constants.fs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ module Constants =
// Time limit used for Create and Extend operations
let internal CircuitOperationTimeout = TimeSpan.FromSeconds 10.

// Time limit used for RendezvousJoin operation
let internal CircuitRendezvousTimeout = TimeSpan.FromMinutes 2.

// Time limit used for StreamBegin operation
let internal StreamCreationTimeout = TimeSpan.FromSeconds 10.

Expand Down
1 change: 1 addition & 0 deletions NOnion/Http/TorHttpClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ open System.IO.Compression

open NOnion
open NOnion.Network
open NOnion.Utility

type TorHttpClient(stream: TorStream, host: string) =

Expand Down
4 changes: 3 additions & 1 deletion NOnion/NOnion.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<Compile Include="Exceptions.fs" />
<Compile Include="HandshakeType.fs" />
<Compile Include="Utility\FSharpUtil.fs" />
<Compile Include="Utility\ResultUtil.fs" />
<Compile Include="Utility\MailboxUtil.fs" />
<Compile Include="Utility\StreamUtil.fs" />
<Compile Include="Utility\SemaphoreLocker.fs" />
<Compile Include="Utility\Base64Util.fs" />
Expand Down Expand Up @@ -97,7 +99,7 @@

<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
</ItemGroup>
</Target>
</Project>
4 changes: 1 addition & 3 deletions NOnion/Network/StreamState.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ type StreamState =
streamId: uint16 *
completionTask: TaskCompletionSource<uint16>
| Connected of streamId: uint16
| Ended of streamId: uint16 * reason: EndReason

member self.Id =
match self with
| Connecting(streamId, _)
| Connected streamId
| Ended(streamId, _) -> string streamId
| Connected streamId -> string streamId
| Initialized -> "TBD"
Loading

0 comments on commit eedb0a8

Please sign in to comment.