# # # patch "network/automate_session.hh" # from [f4a152ca99e1cb1230d2e64b0896b311f584a577] # to [40b95850da8cb9d9dec39b7384db141b1023bb84] # # patch "network/listener.hh" # from [770859fce5cde9d778bd3e03babd933188acdee5] # to [c18763f684c82232aaf8bed82a46cf771586657b] # # patch "network/listener_base.hh" # from [db29dc7652f074e21b800e57a4a3c7ec79a5a24a] # to [ae74c9df28606c7a10147593d9d3d121aafad828] # # patch "network/netsync_session.hh" # from [5d914d855e5f2b486876db5b997d8c65e8751cd3] # to [227867a6d5efdac111d46e129c660fba1c327b4f] # # patch "network/reactable.hh" # from [88bc81d80ae4d3eeef01fb06e5bf7aaff9014955] # to [a769f82855b84d8793b88877c94c51bc0afb6451] # # patch "network/reactor.hh" # from [ca7a364e2a3113f4a51993741149588bd56b7d12] # to [4cece1ddc6667af1d28116dafcc8314bee5ebc3f] # # patch "network/session.hh" # from [aa75d92f160cbacefca549ff1c7f5b9a21c3ed50] # to [f2933718450444adc05d45a42d77d89f8cab9fe6] # # patch "network/session_base.hh" # from [300d67536599a4a9b92927c54ad7def5415301ac] # to [3124c04f30f1a1c68a5734f40b840f6bb56b2a86] # # patch "network/wrapped_session.hh" # from [4110bd6a10485e7114abf283f968efcd27c4037a] # to [388d677f9580972afd9d55c1732c71d67ade92e4] # ============================================================ --- network/automate_session.hh f4a152ca99e1cb1230d2e64b0896b311f584a577 +++ network/automate_session.hh 40b95850da8cb9d9dec39b7384db141b1023bb84 @@ -15,6 +15,8 @@ #include "network/wrapped_session.hh" #include "project.hh" // key_identity_info +// A set of session innards that knows how to forward 'automate stdio' +// over the network. class automate_session : public wrapped_session { app_state & app; ============================================================ --- network/listener.hh 770859fce5cde9d778bd3e03babd933188acdee5 +++ network/listener.hh c18763f684c82232aaf8bed82a46cf771586657b @@ -23,6 +23,8 @@ class transaction_guard; class reactor; class transaction_guard; +// Accepts new network connections and creates 'session' instances +// for them. class listener : public listener_base { app_state & app; ============================================================ --- network/listener_base.hh db29dc7652f074e21b800e57a4a3c7ec79a5a24a +++ network/listener_base.hh ae74c9df28606c7a10147593d9d3d121aafad828 @@ -15,6 +15,10 @@ #include +// This is not currently needed because there's only one kind of listener. +// But it's already here and not hurting anything, and might be useful if +// we want to add another kind of listener later (something that accepts +// http or fastcgi connections?). class listener_base : public reactable { protected: ============================================================ --- network/netsync_session.hh 5d914d855e5f2b486876db5b997d8c65e8751cd3 +++ network/netsync_session.hh 227867a6d5efdac111d46e129c660fba1c327b4f @@ -26,6 +26,7 @@ class cert; class cert; +// A set of session innards that knows how to talk 'netsync'. class netsync_session: public refiner_callbacks, ============================================================ --- network/reactable.hh 88bc81d80ae4d3eeef01fb06e5bf7aaff9014955 +++ network/reactable.hh a769f82855b84d8793b88877c94c51bc0afb6451 @@ -15,6 +15,7 @@ class transaction_guard; class transaction_guard; +// This is something that you can run select() (or equivalent) on. class reactable { static unsigned int count; ============================================================ --- network/reactor.hh ca7a364e2a3113f4a51993741149588bd56b7d12 +++ network/reactor.hh 4cece1ddc6667af1d28116dafcc8314bee5ebc3f @@ -21,6 +21,7 @@ class transaction_guard; class reactable; class transaction_guard; +// This is the main select() (or equivalent) loop. class reactor { bool have_pipe; ============================================================ --- network/session.hh aa75d92f160cbacefca549ff1c7f5b9a21c3ed50 +++ network/session.hh f2933718450444adc05d45a42d77d89f8cab9fe6 @@ -22,6 +22,13 @@ class project_t; class options; class project_t; +// This reads and writes netcmds to the network. +// It only understands a few netcmds for setting up and tearing +// down the connection, other netcmds are handled by a wrapped_session +// which is inserted into the session either at the very beginning +// (for a client) or when the reply to the 'hello' netcmd is received +// (for a server). On the client this insertion is handled by whoever +// created the session, on the server it is handled by the session itself. class session : public session_base { u8 version; ============================================================ --- network/session_base.hh 300d67536599a4a9b92927c54ad7def5415301ac +++ network/session_base.hh 3124c04f30f1a1c68a5734f40b840f6bb56b2a86 @@ -21,6 +21,10 @@ #include "network/reactable.hh" #include "string_queue.hh" +// This is not currently needed because there's only one kind of session. +// But it's already here and not hurting anything, and might be useful if +// we want to add another kind of session later (something that talks +// http or fastcgi?). class session_base : public reactable { void read_some(bool & failed, bool & eof); ============================================================ --- network/wrapped_session.hh 4110bd6a10485e7114abf283f968efcd27c4037a +++ network/wrapped_session.hh 388d677f9580972afd9d55c1732c71d67ade92e4 @@ -25,6 +25,14 @@ struct netsync_error }; +// It would be very nice if netsync_session and automate_session could +// just inherit from session. But, on the server sessions are created +// when accept() returns, and we don't know which kind of session it +// is until the handshake has nearly completed and we've received one +// of (anonymous_cmd, auth_cmd, automate_cmd). So session has a pointer +// to an instance of this class, which will be set to a new +// netsync_session or automate_session as soon as we know which one +// this particular connection is. class wrapped_session { session * owner;