aboutsummaryrefslogtreecommitdiff
path: root/client/src/main.cpp
diff options
context:
space:
mode:
authorauth <[email protected]>2020-07-02 14:20:45 +0200
committerauth <[email protected]>2020-07-02 14:20:45 +0200
commit8c78e28b7ff3fbc7f6a84b6adc417e1ce6ca13a3 (patch)
tree50c160f522ac1b4ba15d6ea471eed913bdc7b246 /client/src/main.cpp
parentAdded json implementation for packets. (diff)
downloadloader-8c78e28b7ff3fbc7f6a84b6adc417e1ce6ca13a3.tar.xz
loader-8c78e28b7ff3fbc7f6a84b6adc417e1ce6ca13a3.zip
Added client timeout.
Added json imports for pe images. Added wrapper to support streaming strings.
Diffstat (limited to 'client/src/main.cpp')
-rw-r--r--client/src/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/main.cpp b/client/src/main.cpp
index c932b44..61b97d5 100644
--- a/client/src/main.cpp
+++ b/client/src/main.cpp
@@ -28,7 +28,19 @@ int main(int argc, char* argv[]) {
return;
}
+ if (message == "timedout") {
+ io::logger->warn("connection timeout.");
+ client.shutdown();
+ }
+
io::logger->info("{}:{}->{}", packet.id, packet.session_id, message);
+
+ std::string imports;
+ client.read_stream(imports);
+
+ auto json = nlohmann::json::parse(imports);
+ std::ofstream o("o");
+ o << std::setw(4) << json;
});
while (client) {