diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-12-29 12:31:01 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-12-29 12:31:01 +0100 |
commit | 4ccd3e2c8af00963ac6d88aac587de016300ed90 (patch) | |
tree | 5c80c01627e76086aa48569c32a0c52a37e21a53 /src/ipcpd/normal/ribmgr.c | |
parent | 43a3231b03aa0a639bcd8d61784c84095edfdb6e (diff) | |
parent | e8d6e91203b0521572b0ae32202e69944dde8f04 (diff) | |
download | ouroboros-4ccd3e2c8af00963ac6d88aac587de016300ed90.tar.gz ouroboros-4ccd3e2c8af00963ac6d88aac587de016300ed90.zip |
Merged in dstaesse/ouroboros/be-normal-dev (pull request #330)
ipcpd: Rename normal/path to normal/pathname
Diffstat (limited to 'src/ipcpd/normal/ribmgr.c')
-rw-r--r-- | src/ipcpd/normal/ribmgr.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index 15c3957f..3b4a5784 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -42,7 +42,7 @@ #include "frct.h" #include "ipcp.h" #include "ro.h" -#include "path.h" +#include "pathname.h" #include "dir.h" #include "static_info.pb-c.h" @@ -971,18 +971,23 @@ static void * cdap_req_handler(void * o) if (opcode == CDAP_START) { if (ribmgr_cdap_start(instance, key, name)) LOG_WARN("CDAP start failed."); + free(name); continue; } else if (opcode == CDAP_STOP) { if (ribmgr_cdap_stop(instance, key, name)) LOG_WARN("CDAP stop failed."); + free(name); continue; } + assert(len > 0); + msg = ro_msg__unpack(NULL, len, data); if (msg == NULL) { cdap_reply_send(instance, key, -1, NULL, 0); LOG_WARN("Failed to unpack RO message"); + free(data); continue; } @@ -996,6 +1001,7 @@ static void * cdap_req_handler(void * o) ro_msg__free_unpacked(msg, NULL); cdap_reply_send(instance, key, 0, NULL, 0); LOG_DBG("Already received this RO."); + free(name); continue; } } @@ -1005,6 +1011,7 @@ static void * cdap_req_handler(void * o) if (ribmgr_cdap_create(instance, key, name, msg)) { LOG_WARN("CDAP create failed."); ro_msg__free_unpacked(msg, NULL); + free(name); continue; } } else if (opcode == CDAP_WRITE) { @@ -1012,24 +1019,28 @@ static void * cdap_req_handler(void * o) msg, flags)) { LOG_WARN("CDAP write failed."); ro_msg__free_unpacked(msg, NULL); + free(name); continue; } } else if (opcode == CDAP_DELETE) { if (ribmgr_cdap_delete(instance, key, name)) { LOG_WARN("CDAP delete failed."); ro_msg__free_unpacked(msg, NULL); + free(name); continue; } } else { LOG_INFO("Unsupported opcode received."); ro_msg__free_unpacked(msg, NULL); cdap_reply_send(instance, key, -1, NULL, 0); + free(name); continue; } if (ro_id_create(name, msg)) { LOG_WARN("Failed to create RO id."); ro_msg__free_unpacked(msg, NULL); + free(name); continue; } @@ -1050,6 +1061,7 @@ static void * cdap_req_handler(void * o) pthread_rwlock_unlock(&rib.flows_lock); } + free(name); ro_msg__free_unpacked(msg, NULL); } |