Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up messages a little
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 30, 2008
1 parent de28df2 commit 469a5b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dtls.c
Expand Up @@ -249,17 +249,17 @@ int setup_dtls(struct anyconnect_info *vpninfo)

int dtls_mainloop(struct anyconnect_info *vpninfo, int *timeout)
{
char buf[2000];
unsigned char buf[2000];
int len;
int work_done = 0;

while ( (len = SSL_read(vpninfo->dtls_ssl, buf, sizeof(buf))) > 0 ) {
if (verbose) {
printf("Received DTLS packet of %d bytes\n", len);
printf("Packet starts %02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
}
if (verbose)
printf("Received DTLS packet 0x%02x of %d bytes\n",
len, buf[0]);

vpninfo->last_dtls_rx = time(NULL);

switch(buf[0]) {
case 0:
queue_new_packet(&vpninfo->incoming_queue, AF_INET, buf+1, len-1);
Expand Down
4 changes: 3 additions & 1 deletion main.c
Expand Up @@ -187,7 +187,9 @@ int main(int argc, char **argv)
if (setup_dtls(vpninfo))
fprintf(stderr, "Set up DTLS failed; using SSL instead\n");

printf("Connected\n");
printf("Connected as %s, using %s\n", vpninfo->vpn_addr,
(vpninfo->dtls_fd==-1)?"SSL":"DTLS");

vpn_mainloop(vpninfo);
exit(1);
}
3 changes: 3 additions & 0 deletions ssl.c
Expand Up @@ -436,6 +436,9 @@ static int start_ssl_connection(struct anyconnect_info *vpninfo)
*next_cstp_option = new_option;
next_cstp_option = &new_option->next;

if (verbose)
printf("DTLS option %s : %s\n", buf, colon);

if (!strcmp(buf + 7, "Keepalive")) {
vpninfo->ssl_keepalive = atol(colon);
} else if (!strcmp(buf + 7, "DPD")) {
Expand Down

0 comments on commit 469a5b3

Please sign in to comment.