Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
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
Pcap-Net
Commits
7a1d0333
Commit
7a1d0333
authored
Jan 17, 2015
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Coverage 96.26%
parent
6e846a4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
WiresharkDatagramComparerIcmp.cs
...src/PcapDotNet.Core.Test/WiresharkDatagramComparerIcmp.cs
+1
-0
HttpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/HttpTests.cs
+9
-0
HttpParser.cs
PcapDotNet/src/PcapDotNet.Packets/Http/HttpParser.cs
+1
-1
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIcmp.cs
View file @
7a1d0333
...
@@ -158,6 +158,7 @@ namespace PcapDotNet.Core.Test
...
@@ -158,6 +158,7 @@ namespace PcapDotNet.Core.Test
default
:
default
:
if
(!
field
.
Name
().
StartsWith
(
"lt2p."
)
&&
if
(!
field
.
Name
().
StartsWith
(
"lt2p."
)
&&
field
.
Name
()
!=
"pweth"
&&
!
field
.
Name
().
StartsWith
(
"pweth."
))
!
field
.
Name
().
StartsWith
(
"pweth."
))
throw
new
InvalidOperationException
(
"Invalid icmp field "
+
field
.
Name
());
throw
new
InvalidOperationException
(
"Invalid icmp field "
+
field
.
Name
());
break
;
break
;
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/HttpTests.cs
View file @
7a1d0333
...
@@ -109,6 +109,8 @@ namespace PcapDotNet.Packets.Test
...
@@ -109,6 +109,8 @@ namespace PcapDotNet.Packets.Test
foreach
(
var
field
in
httpLayer
.
Header
)
foreach
(
var
field
in
httpLayer
.
Header
)
Assert
.
IsFalse
(
field
.
Equals
(
"abc"
));
Assert
.
IsFalse
(
field
.
Equals
(
"abc"
));
foreach
(
var
field
in
(
IEnumerable
)
httpLayer
.
Header
)
Assert
.
IsFalse
(
field
.
Equals
(
"abc"
));
MoreAssert
.
AreSequenceEqual
(
httpLayer
.
Header
.
Select
(
field
=>
field
.
GetHashCode
()),
httpDatagram
.
Header
.
Select
(
field
=>
field
.
GetHashCode
()));
MoreAssert
.
AreSequenceEqual
(
httpLayer
.
Header
.
Select
(
field
=>
field
.
GetHashCode
()),
httpDatagram
.
Header
.
Select
(
field
=>
field
.
GetHashCode
()));
...
@@ -143,6 +145,7 @@ namespace PcapDotNet.Packets.Test
...
@@ -143,6 +145,7 @@ namespace PcapDotNet.Packets.Test
TestHttpRequest
(
"GET /url H"
,
"GET"
,
"/url"
);
TestHttpRequest
(
"GET /url H"
,
"GET"
,
"/url"
);
TestHttpRequest
(
"GET /url HTTP/"
,
"GET"
,
"/url"
);
TestHttpRequest
(
"GET /url HTTP/"
,
"GET"
,
"/url"
);
TestHttpRequest
(
"GET /url HTTP/1.0"
,
"GET"
,
"/url"
,
HttpVersion
.
Version10
);
TestHttpRequest
(
"GET /url HTTP/1.0"
,
"GET"
,
"/url"
,
HttpVersion
.
Version10
);
TestHttpRequest
(
"GET /url HTTP/1234567890.0"
,
"GET"
,
"/url"
);
// Version
TestHttpRequest
(
"GET /url HTTP/1.1"
,
"GET"
,
"/url"
,
HttpVersion
.
Version11
);
TestHttpRequest
(
"GET /url HTTP/1.1"
,
"GET"
,
"/url"
,
HttpVersion
.
Version11
);
TestHttpRequest
(
"GET /url HTTP/1.1A"
,
"GET"
,
"/url"
,
HttpVersion
.
Version11
);
TestHttpRequest
(
"GET /url HTTP/1.1A"
,
"GET"
,
"/url"
,
HttpVersion
.
Version11
);
TestHttpRequest
(
"GET /url HTTP/1.1"
,
"GET"
,
"/url"
);
TestHttpRequest
(
"GET /url HTTP/1.1"
,
"GET"
,
"/url"
);
...
@@ -289,6 +292,12 @@ namespace PcapDotNet.Packets.Test
...
@@ -289,6 +292,12 @@ namespace PcapDotNet.Packets.Test
new
HttpHeader
(
new
HttpHeader
(
new
HttpTransferEncodingField
(
"chunked"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e;f=g;h=\"ijk lmn\""
)));
new
HttpTransferEncodingField
(
"chunked"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e;f=g;h=\"ijk lmn\""
)));
// Illegal byte in double quotes.
TestHttpResponse
(
"HTTP/1.1 200 OK\r\n"
+
"Transfer-Encoding: chunked,a, b , c\r\n\t,d , e;f=g;h=\"\x1Fjk lmn\"\r\n"
,
HttpVersion
.
Version11
,
200
,
"OK"
,
new
HttpHeader
());
// Respone Body
// Respone Body
TestHttpResponse
(
"HTTP/1.1 200 OK\r\n"
+
TestHttpResponse
(
"HTTP/1.1 200 OK\r\n"
+
...
...
PcapDotNet/src/PcapDotNet.Packets/Http/HttpParser.cs
View file @
7a1d0333
...
@@ -308,7 +308,7 @@ namespace PcapDotNet.Packets.Http
...
@@ -308,7 +308,7 @@ namespace PcapDotNet.Packets.Http
// Parse first "
// Parse first "
if
(!
Bytes
(
AsciiBytes
.
DoubleQuotationMark
).
Success
)
if
(!
Bytes
(
AsciiBytes
.
DoubleQuotationMark
).
Success
)
return
this
;
return
this
;
// This cannot happen, since we call this method only when we have '"'.
while
(
IsNext
())
while
(
IsNext
())
{
{
...
...
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