diff -u -p -r1.52 qemud.c --- qemud/qemud.c 26 Jun 2007 23:48:47 -0000 1.52 +++ qemud/qemud.c 11 Jul 2007 19:32:30 -0000 @@ -971,7 +985,6 @@ static int qemudDispatchServer(struct qe /* Unlikely, but ... Next step is to check the certificate. */ if (remoteCheckAccess (client) == -1) goto cleanup; - if (qemudRegisterClientEvent(server, client, 0) < 0) goto cleanup; } else if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) { @@ -1054,7 +1067,7 @@ static int qemudClientRead(struct qemud_ client->direction = gnutls_record_get_direction (client->session); if (qemudRegisterClientEvent (server, client, 1) < 0) qemudDispatchClientFailure (server, client); - if (ret <= 0) { + else if (ret <= 0) { if (ret == 0 || (ret != GNUTLS_E_AGAIN && ret != GNUTLS_E_INTERRUPTED)) { if (ret != 0) @@ -1166,7 +1179,7 @@ static void qemudDispatchClientRead(stru /* Finished. Next step is to check the certificate. */ if (remoteCheckAccess (client) == -1) qemudDispatchClientFailure (server, client); - if (qemudRegisterClientEvent (server, client, 1) < 0) + else if (qemudRegisterClientEvent (server, client, 1) < 0) qemudDispatchClientFailure (server, client); } else if (ret != GNUTLS_E_AGAIN && ret != GNUTLS_E_INTERRUPTED) { qemudLog (QEMUD_ERR, "TLS handshake failed: %s", @@ -1209,7 +1222,7 @@ static int qemudClientWrite(struct qemud client->direction = gnutls_record_get_direction (client->session); if (qemudRegisterClientEvent (server, client, 1) < 0) qemudDispatchClientFailure (server, client); - if (ret < 0) { + else if (ret < 0) { if (ret != GNUTLS_E_INTERRUPTED && ret != GNUTLS_E_AGAIN) { qemudLog (QEMUD_ERR, "gnutls_record_send: %s", gnutls_strerror (ret)); @@ -1253,8 +1266,7 @@ static void qemudDispatchClientWrite(str /* Finished. Next step is to check the certificate. */ if (remoteCheckAccess (client) == -1) qemudDispatchClientFailure (server, client); - - if (qemudRegisterClientEvent (server, client, 1)) + else if (qemudRegisterClientEvent (server, client, 1)) qemudDispatchClientFailure (server, client); } else if (ret != GNUTLS_E_AGAIN && ret != GNUTLS_E_INTERRUPTED) { qemudLog (QEMUD_ERR, "TLS handshake failed: %s",