Code review changes - clarified HTTP serialization

This commit is contained in:
Hamish Milne 2020-03-28 16:29:15 +00:00
parent bbf8e876ab
commit d92b3e9754
3 changed files with 12 additions and 21 deletions

View file

@ -6,6 +6,7 @@
#include <future>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
@ -215,24 +216,6 @@ public:
#ifdef ENABLE_WEB_SERVICE
httplib::Response response;
#endif
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& handle;
ar& session_id;
ar& url;
ar& method;
ar& state;
ar& proxy;
ar& basic_auth;
ar& ssl_config;
ar& socket_buffer_size;
ar& headers;
ar& post_data;
}
friend class boost::serialization::access;
};
struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase {
@ -453,10 +436,18 @@ private:
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
// NOTE: Serialization of the HTTP service is on a 'best effort' basis.
// There is a very good chance that saving/loading during a network connection will break,
// regardless!
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar& ClCertA.certificate;
ar& ClCertA.private_key;
ar& ClCertA.init;
ar& context_counter;
ar& client_certs_counter;
ar& client_certs;
// NOTE: `contexts` is not serialized because it contains non-serializable data. (i.e.
// handles to ongoing HTTP requests.) Serializing across HTTP contexts will break.
}
friend class boost::serialization::access;
};

View file

@ -110,6 +110,7 @@ struct State {
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& memory_ref;
ar& sharedmem_size;
ar& size;
ar& offset;
@ -139,6 +140,7 @@ struct MIC_U::Impl {
if (shared_memory) {
shared_memory->SetName("MIC_U:shared_memory");
state.memory_ref = shared_memory;
state.sharedmem_buffer = shared_memory->GetPointer();
state.sharedmem_size = size;
}

View file

@ -5,10 +5,8 @@
#pragma once
#include <functional>
#include <boost/serialization/access.hpp>
#include "video_core/regs_pipeline.h"
namespace boost::serialization {
class access;
}
namespace Pica {