Skip to content
Permalink
Browse files

Rename handshake action macros

  • Loading branch information...
nickolasburr committed Mar 11, 2018
1 parent d958ec7 commit 07c89f2953e9a695d9fe329a180c1792b8614e81
Showing with 15 additions and 15 deletions.
  1. +3 −3 include/format.h
  2. +12 −12 src/main.c
@@ -7,8 +7,8 @@
#ifndef KEUKA_FORMAT_H
#define KEUKA_FORMAT_H

#define KEUKA_SEND_ARROW "-->"
#define KEUKA_RECV_ARROW "<--"
#define KEUKA_DASH_ARROW "---"
#define KEUKA_OUTBOUND_INDICATOR "-->"
#define KEUKA_INBOUND_INDICATOR "<--"
#define KEUKA_NEUTRAL_INDICATOR "---"

#endif /* KEUKA_FORMAT_H */
@@ -291,7 +291,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Establishing SSL context.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Establishing SSL context.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
}

/**
@@ -305,7 +305,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Error: Unable to establish SSL context.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Error: Unable to establish SSL context.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
} else {
BIO_printf(bp, "Error: Unable to establish SSL context.\n");
}
@@ -317,7 +317,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] SSL context established.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] SSL context established.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
}

/**
@@ -329,7 +329,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Establishing connection to %s.\n", KEUKA_SEND_ARROW, elapsed, hostname);
BIO_printf(bp, "%s [%fs] Establishing connection to %s.\n", KEUKA_OUTBOUND_INDICATOR, elapsed, hostname);
}

/**
@@ -343,7 +343,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Error: Unable to resolve hostname %s.\n", KEUKA_RECV_ARROW, elapsed, hostname);
BIO_printf(bp, "%s [%fs] Error: Unable to resolve hostname %s.\n", KEUKA_INBOUND_INDICATOR, elapsed, hostname);
} else {
BIO_printf(bp, "Error: Unable to resolve hostname %s.\n", hostname);
}
@@ -355,7 +355,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Connection established.\n", KEUKA_RECV_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Connection established.\n", KEUKA_INBOUND_INDICATOR, elapsed);
}

/**
@@ -375,7 +375,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Attaching SSL session to socket.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Attaching SSL session to socket.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
}

/**
@@ -389,7 +389,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Error: Unable to attach SSL session to socket.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Error: Unable to attach SSL session to socket.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
} else {
BIO_printf(bp, "Error: Unable to attach SSL session to socket.\n");
}
@@ -401,8 +401,8 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] SSL session attached to socket.\n", KEUKA_DASH_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Initiating handshake with %s.\n", KEUKA_SEND_ARROW, elapsed, hostname);
BIO_printf(bp, "%s [%fs] SSL session attached to socket.\n", KEUKA_NEUTRAL_INDICATOR, elapsed);
BIO_printf(bp, "%s [%fs] Initiating handshake with %s.\n", KEUKA_OUTBOUND_INDICATOR, elapsed, hostname);
}

/**
@@ -416,7 +416,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Error: Could not build SSL session with %s. Handshake aborted.\n", KEUKA_RECV_ARROW, elapsed, url);
BIO_printf(bp, "%s [%fs] Error: Could not build SSL session with %s. Handshake aborted.\n", KEUKA_INBOUND_INDICATOR, elapsed, url);
} else {
BIO_printf(bp, "Error: Could not build SSL session with %s. Handshake aborted.\n", url);
}
@@ -428,7 +428,7 @@ int main (int argc, char **argv) {
now = clock();
elapsed = ((double) (now - start) / CLOCKS_PER_SEC);

BIO_printf(bp, "%s [%fs] Handshake complete.\n", KEUKA_RECV_ARROW, elapsed);
BIO_printf(bp, "%s [%fs] Handshake complete.\n", KEUKA_INBOUND_INDICATOR, elapsed);

if (pad_fmt) {
BIO_printf(bp, "\n");

0 comments on commit 07c89f2

Please sign in to comment.
You can’t perform that action at this time.