summaryrefslogtreecommitdiffstats
path: root/net/socket/ssl_client_socket_nss.h
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 04:48:06 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 04:48:06 +0000
commita3ff5e91cd38d7af1ce3e2b679d517907d57d20f (patch)
treeca490ac981a3899f8d367354dcd34e8743259d73 /net/socket/ssl_client_socket_nss.h
parent7adaccba309723e23cf444e4d64b5d5a761591e3 (diff)
downloadchromium_src-a3ff5e91cd38d7af1ce3e2b679d517907d57d20f.zip
chromium_src-a3ff5e91cd38d7af1ce3e2b679d517907d57d20f.tar.gz
chromium_src-a3ff5e91cd38d7af1ce3e2b679d517907d57d20f.tar.bz2
Make SSLClientSocketNSS full-duplex
BUG=13289,12497 TEST=visit https site and works as before. Review URL: http://codereview.chromium.org/255074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_nss.h')
-rw-r--r--net/socket/ssl_client_socket_nss.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/net/socket/ssl_client_socket_nss.h b/net/socket/ssl_client_socket_nss.h
index 8cbdff6..1535e04f 100644
--- a/net/socket/ssl_client_socket_nss.h
+++ b/net/socket/ssl_client_socket_nss.h
@@ -57,17 +57,25 @@ class SSLClientSocketNSS : public SSLClientSocket {
private:
void InvalidateSessionIfBadCertificate();
X509Certificate* UpdateServerCert();
- void DoCallback(int result);
+ void DoReadCallback(int result);
+ void DoWriteCallback(int result);
void DoConnectCallback(int result);
- void OnIOComplete(int result);
+ void OnHandshakeIOComplete(int result);
+ void OnSendComplete(int result);
+ void OnRecvComplete(int result);
- int DoLoop(int last_io_result);
- int DoHandshakeRead();
+ int DoHandshakeLoop(int last_io_result);
+ int DoReadLoop(int result);
+ int DoWriteLoop(int result);
+
+ int DoHandshake();
int DoVerifyCert(int result);
int DoVerifyCertComplete(int result);
int DoPayloadRead();
int DoPayloadWrite();
int Init();
+
+ bool DoTransportIO();
int BufferSend(void);
int BufferRecv(void);
void BufferSendComplete(int result);
@@ -87,17 +95,22 @@ class SSLClientSocketNSS : public SSLClientSocket {
bool transport_recv_busy_;
scoped_refptr<IOBuffer> recv_buffer_;
- CompletionCallbackImpl<SSLClientSocketNSS> io_callback_;
+ CompletionCallbackImpl<SSLClientSocketNSS> handshake_io_callback_;
scoped_ptr<ClientSocket> transport_;
std::string hostname_;
SSLConfig ssl_config_;
CompletionCallback* user_connect_callback_;
- CompletionCallback* user_callback_;
+ CompletionCallback* user_read_callback_;
+ CompletionCallback* user_write_callback_;
+
+ // Used by Read function.
+ scoped_refptr<IOBuffer> user_read_buf_;
+ int user_read_buf_len_;
- // Used by both Read and Write functions.
- scoped_refptr<IOBuffer> user_buf_;
- int user_buf_len_;
+ // Used by Write function.
+ scoped_refptr<IOBuffer> user_write_buf_;
+ int user_write_buf_len_;
// Set when handshake finishes.
scoped_refptr<X509Certificate> server_cert_;
@@ -109,13 +122,11 @@ class SSLClientSocketNSS : public SSLClientSocket {
enum State {
STATE_NONE,
- STATE_HANDSHAKE_READ,
+ STATE_HANDSHAKE,
STATE_VERIFY_CERT,
STATE_VERIFY_CERT_COMPLETE,
- STATE_PAYLOAD_WRITE,
- STATE_PAYLOAD_READ,
};
- State next_state_;
+ State next_handshake_state_;
// The NSS SSL state machine
PRFileDesc* nss_fd_;