mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Debugger: Use fragments for long chunks.
Gets it on the wire faster. More importantly, this allows us to usually avoid rampant memory allocation even for large responses.
This commit is contained in:
@@ -32,12 +32,21 @@ JsonWriter &DebuggerRequest::Respond() {
|
||||
void DebuggerRequest::Finish() {
|
||||
if (responseBegun_ && !responseSent_) {
|
||||
writer_.end();
|
||||
ws->Send(writer_.str());
|
||||
if (responsePartial_)
|
||||
ws->AddFragment(true, writer_.str());
|
||||
else
|
||||
ws->Send(writer_.str());
|
||||
responseBegun_ = false;
|
||||
responseSent_ = true;
|
||||
responsePartial_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerRequest::Flush() {
|
||||
ws->AddFragment(false, writer_.flush());
|
||||
responsePartial_ = true;
|
||||
}
|
||||
|
||||
static bool U32FromString(const char *str, uint32_t *out, bool allowFloat) {
|
||||
if (TryParse(str, out))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user