mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
CLOUD: Fix minor Reader-related bugs
This commit is contained in:
parent
b69cc3effb
commit
f3ee9e3272
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user