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
2f8a06d5
Commit
2f8a06d5
authored
Sep 09, 2013
by
Davis King
Browse files
Made HTTP server parsing work when a query like "GET /" comes in that
is missing the HTTP/1.1 version field.
parent
f67cc883
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
dlib/server/server_http.cpp
dlib/server/server_http.cpp
+6
-14
No files found.
dlib/server/server_http.cpp
View file @
2f8a06d5
...
@@ -130,7 +130,7 @@ namespace dlib
...
@@ -130,7 +130,7 @@ namespace dlib
buffer
.
clear
();
buffer
.
clear
();
buffer
.
reserve
(
300
);
buffer
.
reserve
(
300
);
while
(
in
.
peek
()
!=
delim
&&
in
.
peek
()
!=
EOF
&&
buffer
.
size
()
<
max
)
while
(
in
.
peek
()
!=
delim
&&
in
.
peek
()
!=
'\n'
&&
in
.
peek
()
!=
EOF
&&
buffer
.
size
()
<
max
)
{
{
buffer
+=
(
char
)
in
.
get
();
buffer
+=
(
char
)
in
.
get
();
}
}
...
@@ -141,20 +141,12 @@ namespace dlib
...
@@ -141,20 +141,12 @@ namespace dlib
if
(
buffer
.
size
()
==
max
)
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.
in
.
get
();
if
(
in
.
get
()
!=
delim
)
// eat any remaining whitespace
if
(
delim
==
' '
)
{
{
in
.
setstate
(
ios
::
badbit
);
while
(
in
.
peek
()
==
' '
)
buffer
.
clear
();
in
.
get
();
}
else
{
// Read the remaining delimiters
if
(
delim
==
' '
)
{
while
(
in
.
peek
()
==
' '
)
in
.
get
();
}
}
}
}
}
}
}
...
...
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