obj->net_seq_idx = net_seq_idx;
obj->refcount = 0;
obj->destroy_flag = 0;
+ obj->control_sock.sock.fd = -1;
+ obj->data_sock.sock.fd = -1;
lttng_ht_node_init_u64(&obj->node, obj->net_seq_idx);
pthread_mutex_init(&obj->ctrl_sock_mutex, NULL);
char *buf;
uint64_t buf_size = sizeof(header);
+ if (rsock->sock.fd < 0) {
+ return -ECONNRESET;
+ }
+
if (data) {
buf_size += size;
}
{
int ret;
+ if (rsock->sock.fd < 0) {
+ return -ECONNRESET;
+ }
+
DBG3("Relayd waiting for reply of size %zu", size);
ret = rsock->sock.ops->recvmsg(&rsock->sock, data, size, 0);
/* Code flow error. Safety net. */
assert(rsock);
+ if (!rsock->sock.ops) {
+ /*
+ * Attempting a connect on a non-initialized socket.
+ */
+ return -ECONNRESET;
+ }
+
DBG3("Relayd connect ...");
return rsock->sock.ops->connect(&rsock->sock);
PERROR("relayd_close default close");
}
}
+ rsock->sock.fd = -1;
end:
return ret;
assert(rsock);
assert(hdr);
+ if (rsock->sock.fd < 0) {
+ return -ECONNRESET;
+ }
+
DBG3("Relayd sending data header of size %zu", size);
/* Again, safety net */