uint8_t httplog(char status[140] ) { /* Transmission taking action */ if (httplog_tmp_buf) return 0; uint8_t len = strlen(status); if (len > 140) { HTTPLOG_DEBUG("message too long: cropping"); len = 140; } httplog_tmp_buf = malloc(140); if (!httplog_tmp_buf) return 0; memcpy(httplog_tmp_buf, status, len); httplog_tmp_buf[len] = 0; uip_ipaddr_t *ipaddr; if (!(ipaddr = resolv_lookup(CONF_HTTPLOG_SERVICE))) { resolv_query(CONF_HTTPLOG_SERVICE, httplog_dns_query_cb); } else { httplog_dns_query_cb(NULL, ipaddr); } return 1; }
static void httplog_resolve_address(void) { uip_ipaddr_t *ipaddr; if (!(ipaddr = resolv_lookup(CONF_HTTPLOG_SERVICE))) { resolv_query(CONF_HTTPLOG_SERVICE, httplog_dns_query_cb); } else { httplog_dns_query_cb(NULL, ipaddr); } }