- if(read(cl->meta_socket, &((char*)(&tmp))[1], sizeof(tmp) - 3) <= 0)
- {
- syslog(LOG_ERR, "%d: Receive failed: %m", __LINE__);
- return -1;
- }
-
- syslog(LOG_DEBUG, "%08lx %08lx %d %hd", tmp.from, tmp.to, tmp.expiry, tmp.len);
- key = xmalloc(tmp.len);
-
- if(read(cl->meta_socket, key, tmp.len + 2) <= 0)
+ if(!cl->status.active) return -1;
+ if(sscanf(cl->buffer, "%*d %lx %lx %d %as", &to, &from, &expiry, &key) != 4)