A small memory footprint AMQP implimentation

Dependents:   iothub_client_sample_amqp remote_monitoring simplesample_amqp

Revision:
43:4c1e4e94cdd3
Parent:
38:7631b92cc772
--- a/saslclientio.c	Fri May 04 13:24:52 2018 -0700
+++ b/saslclientio.c	Mon Jun 11 15:39:52 2018 -0700
@@ -33,6 +33,12 @@
     SASL_HEADER_EXCHANGE_HEADER_RCVD, \
     SASL_HEADER_EXCHANGE_HEADER_EXCH
 
+// Suppress unused function warning for SASL_HEADER_EXCHANGE_STATEstrings
+#ifdef NO_LOGGING
+#define ENUM_TO_STRING_UNUSED
+#include "azure_c_shared_utility/macro_utils.h"
+#endif
+
 DEFINE_LOCAL_ENUM(SASL_HEADER_EXCHANGE_STATE, SASL_HEADER_EXCHANGE_STATE_VALUES)
 
 #define SASL_CLIENT_NEGOTIATION_STATE_VALUES \
@@ -144,7 +150,7 @@
     }
 }
 
-// This callback usage needs to be either verified and commented or integrated into 
+// This callback usage needs to be either verified and commented or integrated into
 // the state machine.
 static void unchecked_on_send_complete(void* context, IO_SEND_RESULT send_result)
 {
@@ -255,6 +261,7 @@
     }
 }
 
+#ifndef NO_LOGGING
 static const char* get_frame_type_as_string(AMQP_VALUE descriptor)
 {
     const char* result;
@@ -286,6 +293,7 @@
 
     return result;
 }
+#endif // NO_LOGGING
 
 static void log_incoming_frame(AMQP_VALUE performative)
 {
@@ -400,7 +408,7 @@
                     LogError("Invalid SASL header exchange state: %s", ENUM_TO_STRING(SASL_HEADER_EXCHANGE_STATE, sasl_client_io_instance->sasl_header_exchange_state));
                     result = __FAILURE__;
                     break;
-                
+
                 case SASL_HEADER_EXCHANGE_HEADER_SENT:
                     /* from this point on we need to decode SASL frames */
                     sasl_client_io_instance->sasl_header_exchange_state = SASL_HEADER_EXCHANGE_HEADER_EXCH;
@@ -1096,7 +1104,7 @@
             }
         }
     }
-    
+
     return result;
 }