summaryrefslogtreecommitdiff
path: root/tests/handshake-timeout.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2023-04-24 12:39:42 +0900
committerDaiki Ueno <ueno@gnu.org>2023-04-24 12:45:46 +0900
commitaa5950abab56b011331ad4331409b6ff8efb8aeb (patch)
treead363fb38e8b65c942876641cda9c76caa13b498 /tests/handshake-timeout.c
parent0fe9cb6842d63761718046cc7dd7eb437e6c5163 (diff)
downloadgnutls-aa5950abab56b011331ad4331409b6ff8efb8aeb.tar.gz
build: re-indent code
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'tests/handshake-timeout.c')
-rw-r--r--tests/handshake-timeout.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/tests/handshake-timeout.c b/tests/handshake-timeout.c
index 53087aff70..150988e1c4 100644
--- a/tests/handshake-timeout.c
+++ b/tests/handshake-timeout.c
@@ -20,7 +20,7 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <stdio.h>
@@ -37,17 +37,17 @@ int main(void)
#else
-# include <sys/types.h>
-# include <netinet/in.h>
-# include <sys/socket.h>
-# include <sys/wait.h>
-# include <arpa/inet.h>
-# include <unistd.h>
-# include <gnutls/gnutls.h>
-# include <gnutls/dtls.h>
-# include <signal.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <gnutls/gnutls.h>
+#include <gnutls/dtls.h>
+#include <signal.h>
-# include "utils.h"
+#include "utils.h"
/* This program tests whether the handshake timeout value is enforced.
*/
@@ -83,9 +83,8 @@ static void client(int fd, int tmo_ms)
gnutls_handshake_set_timeout(session, tmo_ms);
/* Use default priorities */
- gnutls_priority_set_direct(session,
- "NORMAL:+ANON-ECDH:-VERS-ALL:+VERS-TLS1.2",
- NULL);
+ gnutls_priority_set_direct(
+ session, "NORMAL:+ANON-ECDH:-VERS-ALL:+VERS-TLS1.2", NULL);
/* put the anonymous credentials to the current session
*/
@@ -97,8 +96,7 @@ static void client(int fd, int tmo_ms)
*/
do {
ret = gnutls_handshake(session);
- }
- while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
+ } while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
gnutls_deinit(session);
gnutls_anon_free_client_credentials(anoncred);
@@ -147,9 +145,8 @@ static void server(int fd, int tmo_ms)
/* avoid calling all the priority functions, since the defaults
* are adequate.
*/
- gnutls_priority_set_direct(session,
- "NORMAL:+ANON-ECDH:-VERS-ALL:+VERS-TLS1.2",
- NULL);
+ gnutls_priority_set_direct(
+ session, "NORMAL:+ANON-ECDH:-VERS-ALL:+VERS-TLS1.2", NULL);
gnutls_credentials_set(session, GNUTLS_CRD_ANON, anoncred);
@@ -159,12 +156,12 @@ static void server(int fd, int tmo_ms)
char buf[32];
// read until client closes connection
- while (read(fd, buf, sizeof(buf)) > 0) ;
+ while (read(fd, buf, sizeof(buf)) > 0)
+ ;
} else {
do {
ret = gnutls_handshake(session);
- }
- while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
+ } while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
if (ret == 0)
gnutls_bye(session, GNUTLS_SHUT_RDWR);
@@ -234,4 +231,4 @@ void doit(void)
start(1000);
}
-#endif /* _WIN32 */
+#endif /* _WIN32 */