Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
钟尚武
dlib
Commits
e0b47315
Commit
e0b47315
authored
Sep 06, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleanup and error message improvement.
parent
e5752c34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
server_http.cpp
dlib/server/server_http.cpp
+6
-4
No files found.
dlib/server/server_http.cpp
View file @
e0b47315
...
...
@@ -126,7 +126,7 @@ namespace dlib
)
{
using
namespace
std
;
const
size_t
max
=
16
*
1024
;
const
size_t
max
=
64
*
1024
;
buffer
.
clear
();
buffer
.
reserve
(
300
);
...
...
@@ -136,7 +136,9 @@ namespace dlib
}
// if we quit the loop because the data is longer than expected or we hit EOF
if
(
in
.
peek
()
==
EOF
||
buffer
.
size
()
==
max
)
if
(
in
.
peek
()
==
EOF
)
throw
http_parse_error
(
"HTTP field from client terminated incorrectly"
,
414
);
if
(
buffer
.
size
()
==
max
)
throw
http_parse_error
(
"HTTP field from client is too long"
,
414
);
// Make sure the last char is the delim.
...
...
@@ -186,7 +188,7 @@ namespace dlib
string
first_part_of_header
;
string
::
size_type
position_of_double_point
;
// now loop over all the incoming_headers
while
(
line
.
size
()
>
2
)
while
(
line
!=
"
\r
"
)
{
position_of_double_point
=
line
.
find_first_of
(
':'
);
if
(
position_of_double_point
!=
string
::
npos
)
...
...
@@ -272,7 +274,7 @@ namespace dlib
}
}
// no ':' in it!
read_with_limit
(
in
,
line
);
}
// while (line
.size() > 2
)
}
// while (line
!= "\r"
)
// If there is data being posted back to us as a query string then
...
...
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