Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
e0b47315
Commit
e0b47315
authored
Sep 06, 2013
by
Davis King
Browse files
Minor code cleanup and error message improvement.
parent
e5752c34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
dlib/server/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
...
@@ -126,7 +126,7 @@ namespace dlib
)
)
{
{
using
namespace
std
;
using
namespace
std
;
const
size_t
max
=
1
6
*
1024
;
const
size_t
max
=
6
4
*
1024
;
buffer
.
clear
();
buffer
.
clear
();
buffer
.
reserve
(
300
);
buffer
.
reserve
(
300
);
...
@@ -136,7 +136,9 @@ namespace dlib
...
@@ -136,7 +136,9 @@ namespace dlib
}
}
// if we quit the loop because the data is longer than expected or we hit EOF
// 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
);
throw
http_parse_error
(
"HTTP field from client is too long"
,
414
);
// Make sure the last char is the delim.
// Make sure the last char is the delim.
...
@@ -186,7 +188,7 @@ namespace dlib
...
@@ -186,7 +188,7 @@ namespace dlib
string
first_part_of_header
;
string
first_part_of_header
;
string
::
size_type
position_of_double_point
;
string
::
size_type
position_of_double_point
;
// now loop over all the incoming_headers
// now loop over all the incoming_headers
while
(
line
.
size
()
>
2
)
while
(
line
!=
"
\r
"
)
{
{
position_of_double_point
=
line
.
find_first_of
(
':'
);
position_of_double_point
=
line
.
find_first_of
(
':'
);
if
(
position_of_double_point
!=
string
::
npos
)
if
(
position_of_double_point
!=
string
::
npos
)
...
@@ -272,7 +274,7 @@ namespace dlib
...
@@ -272,7 +274,7 @@ namespace dlib
}
}
}
// no ':' in it!
}
// no ':' in it!
read_with_limit
(
in
,
line
);
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
// 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