/* Status and error notification routines */
bool status_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
+ assert(request);
+ assert(*request);
+
int statusno;
char statusstring[MAX_STRING_SIZE];
}
bool error_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
+ assert(request);
+ assert(*request);
+
int err;
char errorstring[MAX_STRING_SIZE];
(void)mesh;
(void)c;
(void)request;
+
+ assert(request);
+ assert(*request);
+
return false;
}
bool ping_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
(void)request;
+
+ assert(request);
+ assert(*request);
+
return send_pong(mesh, c);
}
bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
(void)mesh;
(void)request;
+
+ assert(request);
+ assert(*request);
+
c->status.pinged = false;
/* Successful connection, reset timeout if this is an outgoing connection. */
+ // TODO: completely remove this outgoing, let the autoconnect algorithm handle it
if(c->outgoing) {
c->outgoing->timeout = 0;
- c->outgoing->cfg = NULL;
+ c->outgoing->state = OUTGOING_START;
if(c->outgoing->ai) {
freeaddrinfo(c->outgoing->ai);
/* Sending and receiving packets via TCP */
bool tcppacket_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
+ assert(request);
+ assert(*request);
+
short int len;
if(sscanf(request, "%*d %hd", &len) != 1) {