--- embedaddon/mpd/src/ccp_deflate.c 2013/07/22 08:44:29 1.1.1.1 +++ embedaddon/mpd/src/ccp_deflate.c 2021/03/17 00:39:23 1.1.1.2 @@ -101,7 +101,11 @@ DeflateInit(Bund b, int dir) strlcat(path, ppphook, sizeof(path)); - id = NgGetNodeID(-1, path); + if ((id = NgGetNodeID(-1, path)) == 0) { + Perror("[%s] Cannot get %s node id", b->name, NG_DEFLATE_NODE_TYPE); + goto fail; + } + if (dir == COMP_DIR_XMIT) { b->ccp.comp_node_id = id; } else { @@ -114,11 +118,14 @@ DeflateInit(Bund b, int dir) NGM_DEFLATE_COOKIE, NGM_DEFLATE_CONFIG, &conf, sizeof(conf)) < 0) { Perror("[%s] can't config %s node at %s", b->name, NG_DEFLATE_NODE_TYPE, path); - NgFuncShutdownNode(gCcpCsock, b->name, path); - return(-1); + goto fail; } return 0; + +fail: + NgFuncShutdownNode(gCcpCsock, b->name, path); + return(-1); } /* @@ -189,6 +196,11 @@ static Mbuf DeflateRecvResetReq(Bund b, int id, Mbuf bp, int *noAck) { char path[NG_PATHSIZ]; + + (void)bp; + (void)id; + (void)noAck; + /* Forward ResetReq to the DEFLATE compression node */ snprintf(path, sizeof(path), "[%x]:", b->ccp.comp_node_id); if (NgSendMsg(gCcpCsock, path, @@ -205,6 +217,7 @@ DeflateRecvResetReq(Bund b, int id, Mbuf bp, int *noAc static Mbuf DeflateSendResetReq(Bund b) { + (void)b; return(NULL); } @@ -216,6 +229,10 @@ static void DeflateRecvResetAck(Bund b, int id, Mbuf bp) { char path[NG_PATHSIZ]; + + (void)bp; + (void)id; + /* Forward ResetReq to the DEFLATE compression node */ snprintf(path, sizeof(path), "[%x]:", b->ccp.decomp_node_id); if (NgSendMsg(gCcpCsock, path, @@ -305,6 +322,9 @@ DeflateDecodeConfigReq(Fsm fp, FsmOption opt, int mode static int DeflateNegotiated(Bund b, int dir) { + (void)b; + (void)dir; + return 1; } @@ -315,6 +335,9 @@ DeflateNegotiated(Bund b, int dir) static int DeflateSubtractBloat(Bund b, int size) { + (void)b; + (void)size; + return(size + CCP_OVERHEAD); /* Compression compensate header size */ }