Skip to content

Commit

Permalink
fewer magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 2, 2008
1 parent 63b7cfd commit 3394745
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dtls.c
Expand Up @@ -263,12 +263,12 @@ int dtls_mainloop(struct anyconnect_info *vpninfo, int *timeout)
vpninfo->dtls_times.last_rx = time(NULL);

switch(buf[0]) {
case 0:
case AC_PKT_DATA:
queue_new_packet(&vpninfo->incoming_queue, AF_INET, buf+1, len-1);
work_done = 1;
break;

case 4: /* DPD response */
case AC_PKT_DPD_RESP:
if (verbose)
printf("Got DTLS DPD response\n");
break;
Expand Down
8 changes: 4 additions & 4 deletions ssl.c
Expand Up @@ -567,12 +567,12 @@ int ssl_mainloop(struct anyconnect_info *vpninfo, int *timeout)
}
vpninfo->ssl_times.last_rx = time(NULL);
switch(buf[6]) {
case 4: /* Keepalive response */
case AC_PKT_DPD_RESP:
if (verbose)
printf("Got CSTP DPD response\n");
continue;

case 0: /* Uncompressed Data */
case AC_PKT_DATA:
if (verbose) {
printf("Received uncompressed data packet of %d bytes\n",
payload_len);
Expand All @@ -582,7 +582,7 @@ int ssl_mainloop(struct anyconnect_info *vpninfo, int *timeout)
work_done = 1;
continue;

case 8: /* Compressed data */
case AC_PKT_COMPRESSED:
if (!vpninfo->deflate) {
fprintf(stderr, "Compressed packet received in !deflate mode\n");
goto unknown_pkt;
Expand All @@ -591,7 +591,7 @@ int ssl_mainloop(struct anyconnect_info *vpninfo, int *timeout)
work_done = 1;
continue;

case 9:
case AC_PKT_TERM_SERVER:
fprintf(stderr, "received server terminate packet\n");
vpninfo->quit_reason = "Server request";
return 1;
Expand Down

0 comments on commit 3394745

Please sign in to comment.