Skip to content

Commit 9510506

Browse files
committed
more cleanup.
1 parent 8c57fd3 commit 9510506

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

dtls/client-dtls-resume.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@
3939
#define MAXLINE 4096
4040
#define SERV_PORT 11111
4141

42-
static int new_udp_client_socket(WOLFSSL * ssl, const char * host);
43-
static int talk_to_server(WOLFSSL * ssl, const char * msg);
42+
static int new_udp_client_socket(WOLFSSL * ssl, const char * host);
43+
static int talk_to_server(WOLFSSL * ssl, const char * msg);
4444

45-
int main (int argc, char** argv)
45+
int
46+
main(int argc,
47+
char * argv[])
4648
{
4749
/* standard variables used in a dtls client*/
4850
int sockfd = 0;
@@ -52,7 +54,6 @@ int main (int argc, char** argv)
5254
WOLFSSL * ssl_res = NULL; /* The ssl for resuming connection. */
5355
WOLFSSL_CTX * ctx = NULL;
5456
WOLFSSL_SESSION * session = NULL;
55-
//const char * msg = "client testing session resume";
5657
char cert_array[] = "../certs/ca-cert.pem";
5758
char buffer[80];
5859
char * certs = cert_array;
@@ -258,7 +259,7 @@ talk_to_server(WOLFSSL * ssl,
258259
}
259260

260261
recv_msg[recv_len] = '\0';
261-
fputs(recv_msg, stdout);
262+
printf("info: server response: %s", recv_msg);
262263

263264
return 0;
264265
}

dtls/server-dtls.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ int main(int argc, char** argv)
194194
int readErr = wolfSSL_get_error(ssl, 0);
195195
if(readErr != SSL_ERROR_WANT_READ) {
196196
printf("SSL_read failed.\n");
197-
goto error;
197+
break;
198198
}
199199
}
200200
if (wolfSSL_write(ssl, ack, sizeof(ack)) < 0) {
201201
printf("wolfSSL_write fail.\n");
202-
goto error;
202+
break;
203203
}
204204
else {
205205
printf("Sending reply.\n");
@@ -217,7 +217,6 @@ int main(int argc, char** argv)
217217
printf("Client left cont to idle state\n");
218218
}
219219

220-
error:
221220
if (cleanup == 1) {
222221
wolfSSL_set_fd(ssl, 0);
223222
wolfSSL_shutdown(ssl);

0 commit comments

Comments
 (0)