diff options
author | Søren Sandmann <sandmann@redhat.com> | 2008-03-25 01:02:23 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@redhat.com> | 2008-03-25 01:02:23 -0400 |
commit | b3c1cfea79de92bc5b37b9978ec4858074ee88fe (patch) | |
tree | 4b2b76de372a436105a33c3dfe36c43b1e0a7826 | |
parent | 68c324ae8a0b85b4afe4a8cf051f0b552149ee69 (diff) |
Change name from need_handshake to did_handshake
-rw-r--r-- | src/lactlsconnection.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lactlsconnection.c b/src/lactlsconnection.c index 5769522..9106f7a 100644 --- a/src/lactlsconnection.c +++ b/src/lactlsconnection.c @@ -37,7 +37,7 @@ struct _LacTlsConnection gnutls_certificate_credentials_t xcred; gnutls_session_t session; - gboolean need_handshake; + gboolean did_handshake; }; static void @@ -69,13 +69,9 @@ print_alert (gnutls_session session) static void do_handshake (LacTlsConnection *tls) { - if (!tls->need_handshake) + if (tls->did_handshake) return; -#if 0 - g_print ("handshaking\n"); -#endif - int res = gnutls_handshake (tls->session); if (res == 0) @@ -85,7 +81,7 @@ do_handshake (LacTlsConnection *tls) g_print (" handshake complete\n"); #endif - tls->need_handshake = FALSE; + tls->did_handshake = TRUE; /* We consider CONNECT to mean 'handshake complete' * Maybe worthwhile considering a separate HANDSHAKE @@ -124,7 +120,7 @@ do_writes (LacTlsConnection *connection) if (!lac_connection_is_connected (connection->tcp_connection)) return; - if (connection->need_handshake) + if (!connection->did_handshake) return; do @@ -178,7 +174,7 @@ handle_read (LacTlsConnection *tls, enum { BUF_SIZE = 8192 }; GError *err = NULL; - if (tls->need_handshake) + if (!tls->did_handshake) return; queue = lac_byte_queue_new (); @@ -309,7 +305,7 @@ lac_tls_connection_new (const LacAddress *address, tls->tcp_connection = lac_connection_new_tcp ( address, port, tcp_callback, tls); - tls->need_handshake = TRUE; + tls->did_handshake = FALSE; tls->callback = callback; tls->data = data; tls->buffer = lac_byte_queue_new (); @@ -373,7 +369,7 @@ lac_tls_connection_is_connected (LacTlsConnection *connection) { return lac_connection_is_connected (connection->tcp_connection) && - !connection->need_handshake; + connection->did_handshake; } void |