Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: remoting/host/gnubby_auth_handler_posix.h

Issue 205493005: Do minimal processing of gnubby data. Add request timeouts and send error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/gnubby_auth_handler_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/gnubby_auth_handler_posix.h
diff --git a/remoting/host/gnubby_auth_handler_posix.h b/remoting/host/gnubby_auth_handler_posix.h
index ea0e3b6175b4c006b79c47069a56716ad5705142..db38886c8d425c88281cbbed5cf1606e76027026 100644
--- a/remoting/host/gnubby_auth_handler_posix.h
+++ b/remoting/host/gnubby_auth_handler_posix.h
@@ -7,19 +7,24 @@
#include <map>
#include <string>
-#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "net/socket/stream_listen_socket.h"
#include "remoting/host/gnubby_auth_handler.h"
+namespace base {
+class DictionaryValue;
+} // namespace base
+
namespace remoting {
namespace protocol {
class ClientStub;
} // namespace protocol
+class GnubbySocket;
+
class GnubbyAuthHandlerPosix : public GnubbyAuthHandler,
public base::NonThreadSafe,
public net::StreamListenSocket::Delegate {
@@ -28,8 +33,13 @@ class GnubbyAuthHandlerPosix : public GnubbyAuthHandler,
virtual ~GnubbyAuthHandlerPosix();
bool HasActiveSocketForTesting(net::StreamListenSocket* socket) const;
+ int GetConnectionIdForTesting(net::StreamListenSocket* socket) const;
+ GnubbySocket* GetGnubbySocketForTesting(
+ net::StreamListenSocket* socket) const;
private:
+ typedef std::map<int, GnubbySocket*> ActiveSockets;
+
// GnubbyAuthHandler interface.
virtual void DeliverClientMessage(const std::string& message) OVERRIDE;
virtual void DeliverHostDataMessage(int connection_id,
@@ -47,7 +57,16 @@ class GnubbyAuthHandlerPosix : public GnubbyAuthHandler,
void CreateAuthorizationSocket();
// Process a gnubby request.
- void ProcessGnubbyRequest(int connection_id, const char* data, int data_len);
+ void ProcessGnubbyRequest(int connection_id, const std::string& request_data);
+
+ // Gets an active socket iterator for the connection id in |message|.
+ ActiveSockets::iterator GetSocketForMessage(base::DictionaryValue* message);
+
+ // Send an error and close an active socket.
+ void SendErrorAndCloseActiveSocket(const ActiveSockets::iterator& iter);
+
+ // A request timed out.
+ void RequestTimedOut(int connection_id);
// Interface through which communication with the client occurs.
protocol::ClientStub* client_stub_;
@@ -59,13 +78,8 @@ class GnubbyAuthHandlerPosix : public GnubbyAuthHandler,
int last_connection_id_;
// Sockets by connection id used to process gnubbyd requests.
- typedef std::map<int, net::StreamListenSocket*> ActiveSockets;
ActiveSockets active_sockets_;
- // Partial gnubbyd request data by connection id.
- typedef std::map<int, std::vector<char> > ActiveRequests;
- ActiveRequests active_requests_;
-
DISALLOW_COPY_AND_ASSIGN(GnubbyAuthHandlerPosix);
};
« no previous file with comments | « no previous file | remoting/host/gnubby_auth_handler_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698