fixed compiler errors for SSL mode

This commit is contained in:
Tijn Kooijmans
2017-07-21 21:23:41 +02:00
parent fb70e12c6a
commit 85b37ee92b
2 changed files with 4 additions and 4 deletions

View File

@@ -6,6 +6,9 @@
#include "mqtt_msg.h" #include "mqtt_msg.h"
#include "ringbuf.h" #include "ringbuf.h"
#if defined(CONFIG_MQTT_SECURITY_ON)
#include "openssl/ssl.h"
#endif
typedef struct mqtt_client mqtt_client; typedef struct mqtt_client mqtt_client;
typedef struct mqtt_event_data_t mqtt_event_data_t; typedef struct mqtt_event_data_t mqtt_event_data_t;

5
mqtt.c
View File

@@ -13,9 +13,6 @@
#include "lwip/sockets.h" #include "lwip/sockets.h"
#include "lwip/dns.h" #include "lwip/dns.h"
#include "lwip/netdb.h" #include "lwip/netdb.h"
#if defined(CONFIG_MQTT_SECURITY_ON)
#include "openssl/ssl.h"
#endif
#include "ringbuf.h" #include "ringbuf.h"
#include "mqtt.h" #include "mqtt.h"
@@ -222,7 +219,7 @@ int mqtt_write(mqtt_client *client, const void *buffer, int len, int timeout_ms)
} }
#if defined(CONFIG_MQTT_SECURITY_ON) #if defined(CONFIG_MQTT_SECURITY_ON)
result = SSL_write(client->ssl, buffer, len) result = SSL_write(client->ssl, buffer, len);
#else #else
result = write(client->socket, buffer, len); result = write(client->socket, buffer, len);
#endif #endif