Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
00aad2dc
Commit
00aad2dc
authored
Jun 09, 2017
by
justcoding121
Committed by
justcoding121
Jun 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use concurrent dict in example
parent
5402cb90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+3
-2
README.md
README.md
+2
-1
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
00aad2dc
using
System
;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Net
;
using
System.Net
;
using
System.Net.Security
;
using
System.Net.Security
;
...
@@ -16,8 +17,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -16,8 +17,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
//share requestBody outside handlers
//share requestBody outside handlers
//Using a dictionary is not a good idea since it can cause memory overflow
//Using a dictionary is not a good idea since it can cause memory overflow
//ideally the data should be moved out of memory
//ideally the data should be moved out of memory
//private readonly
Dictionary<Guid, string> requestBodyHistory
private
readonly
I
Dictionary
<
Guid
,
string
>
requestBodyHistory
// = new
Dictionary<Guid, string>();
=
new
Concurrent
Dictionary
<
Guid
,
string
>();
public
ProxyTestController
()
public
ProxyTestController
()
{
{
...
...
README.md
View file @
00aad2dc
...
@@ -112,7 +112,8 @@ Sample request and response event handlers
...
@@ -112,7 +112,8 @@ Sample request and response event handlers
```
csharp
```
csharp
//To access requestBody from OnResponse handler
//To access requestBody from OnResponse handler
private
Dictionary
<
Guid
,
string
>
requestBodyHistory
=
new
Dictionary
<
Guid
,
string
>();
private
IDictionary
<
Guid
,
string
>
requestBodyHistory
=
new
ConcurrentDictionary
<
Guid
,
string
>();
public
async
Task
OnRequest
(
object
sender
,
SessionEventArgs
e
)
public
async
Task
OnRequest
(
object
sender
,
SessionEventArgs
e
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment