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
9520d36f
Commit
9520d36f
authored
Jan 30, 2017
by
mikhaylov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessery dependency on DotNetZip library
parent
9020e09f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
7 additions
and
82 deletions
+7
-82
CompressionFactory.cs
Titanium.Web.Proxy/Compression/CompressionFactory.cs
+0
-2
GZipCompression.cs
Titanium.Web.Proxy/Compression/GZipCompression.cs
+2
-2
ZlibCompression.cs
Titanium.Web.Proxy/Compression/ZlibCompression.cs
+0
-25
DecompressionFactory.cs
Titanium.Web.Proxy/Decompression/DecompressionFactory.cs
+0
-2
DeflateDecompression.cs
Titanium.Web.Proxy/Decompression/DeflateDecompression.cs
+4
-6
ZlibDecompression.cs
Titanium.Web.Proxy/Decompression/ZlibDecompression.cs
+0
-33
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+1
-1
Titanium.Web.Proxy.csproj
Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
+0
-7
packages.config
Titanium.Web.Proxy/packages.config
+0
-4
No files found.
Titanium.Web.Proxy/Compression/CompressionFactory.cs
View file @
9520d36f
...
...
@@ -13,8 +13,6 @@
return
new
GZipCompression
();
case
"deflate"
:
return
new
DeflateCompression
();
case
"zlib"
:
return
new
ZlibCompression
();
default
:
return
null
;
}
...
...
Titanium.Web.Proxy/Compression/GZipCompression.cs
View file @
9520d36f
using
Ionic.Zlib
;
using
System.IO
;
using
System.IO
;
using
System.IO
.Compression
;
using
System.Threading.Tasks
;
namespace
Titanium.Web.Proxy.Compression
...
...
Titanium.Web.Proxy/Compression/ZlibCompression.cs
deleted
100644 → 0
View file @
9020e09f
using
Ionic.Zlib
;
using
System.IO
;
using
System.Threading.Tasks
;
namespace
Titanium.Web.Proxy.Compression
{
/// <summary>
/// concrete implementation of zlib compression
/// </summary>
internal
class
ZlibCompression
:
ICompression
{
public
async
Task
<
byte
[
]>
Compress
(
byte
[]
responseBody
)
{
using
(
var
ms
=
new
MemoryStream
())
{
using
(
var
zip
=
new
ZlibStream
(
ms
,
CompressionMode
.
Compress
,
true
))
{
await
zip
.
WriteAsync
(
responseBody
,
0
,
responseBody
.
Length
);
}
return
ms
.
ToArray
();
}
}
}
}
Titanium.Web.Proxy/Decompression/DecompressionFactory.cs
View file @
9520d36f
...
...
@@ -13,8 +13,6 @@
return
new
GZipDecompression
();
case
"deflate"
:
return
new
DeflateDecompression
();
case
"zlib"
:
return
new
ZlibDecompression
();
default
:
return
new
DefaultDecompression
();
}
...
...
Titanium.Web.Proxy/Decompression/DeflateDecompression.cs
View file @
9520d36f
using
Ionic.Zlib
;
using
System.IO
;
using
System.IO
;
using
System.IO
.Compression
;
using
System.Threading.Tasks
;
using
Titanium.Web.Proxy.Shared
;
namespace
Titanium.Web.Proxy.Decompression
{
...
...
@@ -12,8 +11,7 @@ namespace Titanium.Web.Proxy.Decompression
{
public
async
Task
<
byte
[
]>
Decompress
(
byte
[]
compressedArray
,
int
bufferSize
)
{
var
stream
=
new
MemoryStream
(
compressedArray
);
using
(
var
stream
=
new
MemoryStream
(
compressedArray
))
using
(
var
decompressor
=
new
DeflateStream
(
stream
,
CompressionMode
.
Decompress
))
{
var
buffer
=
new
byte
[
bufferSize
];
...
...
@@ -23,7 +21,7 @@ namespace Titanium.Web.Proxy.Decompression
int
read
;
while
((
read
=
await
decompressor
.
ReadAsync
(
buffer
,
0
,
buffer
.
Length
))
>
0
)
{
await
output
.
WriteAsync
(
buffer
,
0
,
read
);
await
output
.
WriteAsync
(
buffer
,
0
,
read
);
}
return
output
.
ToArray
();
...
...
Titanium.Web.Proxy/Decompression/ZlibDecompression.cs
deleted
100644 → 0
View file @
9020e09f
using
Ionic.Zlib
;
using
System.IO
;
using
System.Threading.Tasks
;
using
Titanium.Web.Proxy.Shared
;
namespace
Titanium.Web.Proxy.Decompression
{
/// <summary>
/// concrete implemetation of zlib de-compression
/// </summary>
internal
class
ZlibDecompression
:
IDecompression
{
public
async
Task
<
byte
[
]>
Decompress
(
byte
[]
compressedArray
,
int
bufferSize
)
{
var
memoryStream
=
new
MemoryStream
(
compressedArray
);
using
(
var
decompressor
=
new
ZlibStream
(
memoryStream
,
CompressionMode
.
Decompress
))
{
var
buffer
=
new
byte
[
bufferSize
];
using
(
var
output
=
new
MemoryStream
())
{
int
read
;
while
((
read
=
await
decompressor
.
ReadAsync
(
buffer
,
0
,
buffer
.
Length
))
>
0
)
{
await
output
.
WriteAsync
(
buffer
,
0
,
read
);
}
return
output
.
ToArray
();
}
}
}
}
}
Titanium.Web.Proxy/RequestHandler.cs
View file @
9520d36f
...
...
@@ -568,7 +568,7 @@ namespace Titanium.Web.Proxy
{
//these are the only encoding this proxy can read
case
"accept-encoding"
:
header
.
Value
=
"gzip,deflate
,zlib
"
;
header
.
Value
=
"gzip,deflate"
;
break
;
default
:
...
...
Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
View file @
9520d36f
...
...
@@ -42,10 +42,6 @@
<AssemblyOriginatorKeyFile>
StrongNameKey.snk
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Ionic.Zip, Version=1.9.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL"
>
<HintPath>
..\packages\DotNetZip.1.9.8\lib\net20\Ionic.Zip.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Net"
/>
<Reference
Include=
"System.configuration"
/>
...
...
@@ -62,13 +58,11 @@
<Compile
Include=
"Compression\DeflateCompression.cs"
/>
<Compile
Include=
"Compression\GZipCompression.cs"
/>
<Compile
Include=
"Compression\ICompression.cs"
/>
<Compile
Include=
"Compression\ZlibCompression.cs"
/>
<Compile
Include=
"Decompression\DecompressionFactory.cs"
/>
<Compile
Include=
"Decompression\DefaultDecompression.cs"
/>
<Compile
Include=
"Decompression\DeflateDecompression.cs"
/>
<Compile
Include=
"Decompression\GZipDecompression.cs"
/>
<Compile
Include=
"Decompression\IDecompression.cs"
/>
<Compile
Include=
"Decompression\ZlibDecompression.cs"
/>
<Compile
Include=
"EventArguments\CertificateSelectionEventArgs.cs"
/>
<Compile
Include=
"EventArguments\CertificateValidationEventArgs.cs"
/>
<Compile
Include=
"Extensions\ByteArrayExtensions.cs"
/>
...
...
@@ -123,7 +117,6 @@
</ItemGroup>
<ItemGroup>
<None
Include=
"app.config"
/>
<None
Include=
"packages.config"
/>
<None
Include=
"StrongNameKey.snk"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
...
...
Titanium.Web.Proxy/packages.config
deleted
100644 → 0
View file @
9020e09f
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"DotNetZip"
version
=
"1.9.8"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
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