summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/fa.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-02-10 10:12:02 +0100
committerSander Vrijders <[email protected]>2018-02-10 13:13:49 +0100
commit5d8519018bda6af03c116604a2922625b00f8e52 (patch)
tree36834e9ef8ed4bb1e3cd027ecb50424f2fe44cb0 /src/ipcpd/normal/fa.c
parent544ad6f9759de6acc109307caee2100478cba8ed (diff)
downloadouroboros-5d8519018bda6af03c116604a2922625b00f8e52.tar.gz
ouroboros-5d8519018bda6af03c116604a2922625b00f8e52.zip
ipcpd: Revise lookup tracking in DHT
The lookups now track the responses by cookie instead of just counting the remaining number of responses. This is needed because simultaneous lookups for the same hash interfere with eachother and lead to missed responses. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/normal/fa.c')
-rw-r--r--src/ipcpd/normal/fa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipcpd/normal/fa.c b/src/ipcpd/normal/fa.c
index 8d8b51ee..2b3f5c2a 100644
--- a/src/ipcpd/normal/fa.c
+++ b/src/ipcpd/normal/fa.c
@@ -229,10 +229,12 @@ int fa_alloc(int fd,
uint64_t addr;
struct shm_du_buff * sdb;
- if (ipcp_sdb_reserve(&sdb, sizeof(*msg) + ipcp_dir_hash_len()))
+ addr = dir_query(dst);
+ if (addr == 0)
return -1;
- addr = dir_query(dst);
+ if (ipcp_sdb_reserve(&sdb, sizeof(*msg) + ipcp_dir_hash_len()))
+ return -1;
msg = (struct fa_msg *) shm_du_buff_head(sdb);
msg->code = FLOW_REQ;