diff options
author | Alexander Tkachev | 2016-06-16 11:44:07 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 6e1b667dd67b3a99f2a8a2b27cf3dfe032981cbd (patch) | |
tree | 0f38cf96bde2ccdec52a73a04a1c1b189462191d /backends/networking | |
parent | 13c54f66850226a516da0450b633ebafbc26584e (diff) | |
download | scummvm-rg350-6e1b667dd67b3a99f2a8a2b27cf3dfe032981cbd.tar.gz scummvm-rg350-6e1b667dd67b3a99f2a8a2b27cf3dfe032981cbd.tar.bz2 scummvm-rg350-6e1b667dd67b3a99f2a8a2b27cf3dfe032981cbd.zip |
CLOUD: Minor Client fix
Diffstat (limited to 'backends/networking')
-rw-r--r-- | backends/networking/sdl_net/client.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/networking/sdl_net/client.cpp b/backends/networking/sdl_net/client.cpp index 22bfb60a2f..0e86610e54 100644 --- a/backends/networking/sdl_net/client.cpp +++ b/backends/networking/sdl_net/client.cpp @@ -88,8 +88,11 @@ void Client::checkIfBadRequest() { if (position) { //we have at least one line - and we want the first one //"<METHOD> <path> HTTP/<VERSION>\r\n" Common::String method, path, http, buf; + uint32 length = position - cstr; + if (headersSize > length) headersSize = length; for (uint32 i = 0; i < headersSize; ++i) { - if (_headers[i] == ' ') { + if (_headers[i] != ' ') buf += _headers[i]; + if (_headers[i] == ' ' || i == headersSize-1) { if (method == "") method = buf; else if (path == "") path = buf; else if (http == "") http = buf; @@ -98,7 +101,7 @@ void Client::checkIfBadRequest() { break; } buf = ""; - } else buf += _headers[i]; + } } //check that method is supported |