mqtt: FIX: update hack to handle dummy packet for TCP connect

The zero bytes hack to connect was deprecated by last
commits, so now we send 1 byte initialized to 0 :).

Jira: ZEP-612

Change-Id: I372964bbb102811d33509ad9386d9b360032a180
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit is contained in:
Flavio Santes 2016-08-03 19:44:15 -05:00
commit dde410e2a6

View file

@ -87,7 +87,8 @@ void netz_remote_ipv4(struct netz_ctx_t *ctx, uint8_t a1, uint8_t a2,
static int netz_prepare(struct netz_ctx_t *ctx, enum ip_protocol proto) static int netz_prepare(struct netz_ctx_t *ctx, enum ip_protocol proto)
{ {
#ifdef CONFIG_NETWORKING_WITH_TCP #ifdef CONFIG_NETWORKING_WITH_TCP
struct app_buf_t buf = APP_BUF_INIT(NULL, 0, 0); uint8_t data = 0;
struct app_buf_t buf = APP_BUF_INIT(&data, 1, 1);
int rc; int rc;
#endif #endif
@ -205,6 +206,7 @@ int netz_tx(struct netz_ctx_t *ctx, struct app_buf_t *buf)
rc = tcp_tx(ctx->net_ctx, buf->buf, buf->length, rc = tcp_tx(ctx->net_ctx, buf->buf, buf->length,
ctx->tx_retry_timeout); ctx->tx_retry_timeout);
/* space left for debugging */
return rc; return rc;
} }
@ -219,5 +221,6 @@ int netz_rx(struct netz_ctx_t *ctx, struct app_buf_t *buf)
rc = tcp_rx(ctx->net_ctx, buf->buf, &buf->length, buf->size, rc = tcp_rx(ctx->net_ctx, buf->buf, &buf->length, buf->size,
ctx->rx_timeout); ctx->rx_timeout);
/* space left for debugging */
return rc; return rc;
} }