diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/module.mk | 3 | ||||
-rw-r--r-- | backends/networking/sdl_net/client.cpp | 3 | ||||
-rw-r--r-- | backends/networking/sdl_net/reader.cpp | 6 | ||||
-rw-r--r-- | backends/networking/sdl_net/reader.h | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/backends/module.mk b/backends/module.mk index b1aced43a8..3c6f5e5c39 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -65,7 +65,8 @@ MODULE_OBJS += \ networking/sdl_net/handlers/filespagehandler.o \ networking/sdl_net/handlers/indexpagehandler.o \ networking/sdl_net/handlers/resourcehandler.o \ - networking/sdl_net/localwebserver.o + networking/sdl_net/localwebserver.o \ + networking/sdl_net/reader.o endif ifdef USE_ELF_LOADER diff --git a/backends/networking/sdl_net/client.cpp b/backends/networking/sdl_net/client.cpp index 3edf9c32f5..32aa1e4bef 100644 --- a/backends/networking/sdl_net/client.cpp +++ b/backends/networking/sdl_net/client.cpp @@ -44,7 +44,8 @@ void Client::open(SDLNet_SocketSet set, TCPsocket socket) { _state = READING_HEADERS; _socket = socket; _set = set; - _reader = Reader(); + Reader cleanReader; + _reader = cleanReader; _handler = nullptr; if (set) { int numused = SDLNet_TCP_AddSocket(set, socket); diff --git a/backends/networking/sdl_net/reader.cpp b/backends/networking/sdl_net/reader.cpp index 7fe9d7b15a..698c20919e 100644 --- a/backends/networking/sdl_net/reader.cpp +++ b/backends/networking/sdl_net/reader.cpp @@ -157,7 +157,7 @@ bool Reader::readRequest() { bts += readOne(); if (bts == "--") break; if (bts == "\r\n") continue; - warning("strange bytes: \"%s\"", bts); + warning("strange bytes: \"%s\"", bts.c_str()); } else { warning("strange ending"); break; @@ -327,7 +327,7 @@ void Reader::parseQueryParameters() { } else key += _query[i]; } else { if (_query[i] == '&') { - if (_queryParameters.contains(key)) warning("Query parameter \"%s\" is already set!"); + if (_queryParameters.contains(key)) warning("Query parameter \"%s\" is already set!", key.c_str()); else _queryParameters[key] = LocalWebserver::urlDecode(value); readingKey = true; key = ""; @@ -336,7 +336,7 @@ void Reader::parseQueryParameters() { } if (!key.empty()) { - if (_queryParameters.contains(key)) warning("Query parameter \"%s\" is already set!"); + if (_queryParameters.contains(key)) warning("Query parameter \"%s\" is already set!", key.c_str()); else _queryParameters[key] = LocalWebserver::urlDecode(value); } } diff --git a/backends/networking/sdl_net/reader.h b/backends/networking/sdl_net/reader.h index 09550e09c9..de0f3b668f 100644 --- a/backends/networking/sdl_net/reader.h +++ b/backends/networking/sdl_net/reader.h @@ -79,8 +79,8 @@ class Reader { void makeWindow(uint32 size); void freeWindow(); - bool Reader::readOneByteInStream(Common::WriteStream *stream, const Common::String &boundary); - bool Reader::readOneByteInString(Common::String &buffer, const Common::String &boundary); + bool readOneByteInStream(Common::WriteStream *stream, const Common::String &boundary); + bool readOneByteInString(Common::String &buffer, const Common::String &boundary); byte readOne(); uint32 bytesLeft(); |