mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2025-02-24 05:02:53 +00:00
fix fillp clean code problem
Signed-off-by: h00622836 <huwei138@huawei.com>
This commit is contained in:
parent
49a5006212
commit
46da063ee9
@ -564,7 +564,7 @@ static FILLP_INT SpungeEpollCtlHandleAddEvent(
|
||||
struct FtSocket *epollSock,
|
||||
struct FtSocket *sock,
|
||||
FILLP_INT epFd,
|
||||
struct EpItem *epi,
|
||||
FILLP_CONST struct EpItem *epi,
|
||||
FILLP_CONST struct SpungeEpollEvent *event)
|
||||
{
|
||||
FILLP_INT error = 0;
|
||||
|
@ -627,7 +627,7 @@ static struct FillpPcbItem *SockRecvReqFpcbItemWithoutSem(struct FtSocket *sock,
|
||||
}
|
||||
|
||||
if ((SOCK_IS_NONBLOCKING(sock) || ((FILLP_UINT32)flags & MSG_DONTWAIT))) {
|
||||
FILLP_LOGDBG("fillp_sock_id:%d, Fail to get dat buffer to recv", sock->index);
|
||||
FILLP_LOGDBG("fillp_sock_id:%d, Fail to get data buffer to recv", sock->index);
|
||||
break;
|
||||
}
|
||||
SOCK_RECV_CPU_PAUSE(); // To reduce cpu usage of send api
|
||||
|
@ -136,8 +136,6 @@ void SpungeDelEpInstFromFtSocket(struct FtSocket *sock, FILLP_INT epFd)
|
||||
if (sock->associatedEpollInstanceIdx > 0) {
|
||||
sock->associatedEpollInstanceIdx--;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -61,8 +61,6 @@ static void FillpDelPktSeqHashItem(FILLP_UINT32 pktNum, FILLP_CONST struct Fillp
|
||||
if (pos != FILLP_NULL_PTR) {
|
||||
HlistDelete(list, pos);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpMoveUnackToUnrecv(FILLP_UINT32 ackSeq, FILLP_UINT32 lostSeq, struct FillpPcb *pcb,
|
||||
@ -167,8 +165,6 @@ void FillpMoveUnackToUnrecvAll(FILLP_UINT32 ackSeq, FILLP_UINT32 lostSeq, struct
|
||||
if (pcb->send.unrecvList.nodeNum > 0) {
|
||||
FillpEnableSendTimer(pcb);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void LogForMsgRTT(const struct FillpPcbItem *item)
|
||||
@ -206,8 +202,6 @@ static void FillpAckItemWaitTklist(struct FillpPcb *pcb, FILLP_UINT32 seqNum)
|
||||
#endif /* SOCK_SEND_SEM */
|
||||
node = SkipListGetPop(&pcb->send.itemWaitTokenLists);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int FillpAckUnrecvList(struct FillpPcb *pcb, FILLP_UINT32 seqNum)
|
||||
@ -272,8 +266,6 @@ static void FillpAckRedunlist(struct FillpPcb *pcb, FILLP_UINT32 seqNum)
|
||||
#endif /* SOCK_SEND_SEM */
|
||||
node = SkipListGetPop(&pcb->send.redunList);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void FreeUnackList(struct FillpPcb *pcb, struct FillpPcbItem *item, struct Hlist *tempCtl)
|
||||
@ -314,7 +306,6 @@ static void FillpAckUnackList(struct FillpPcb *pcb, FILLP_UINT32 curSeq, FILLP_I
|
||||
goto END;
|
||||
}
|
||||
|
||||
// Still need to check if should loop all list
|
||||
struct FillpHashLlist *unackList = &(pcb->send.unackList);
|
||||
FILLP_UINT32 unackListSize = unackList->size;
|
||||
FILLP_UINT32 hashModSize = unackList->hashModSize;
|
||||
@ -365,8 +356,6 @@ void FillpAckSendPcb(struct FillpPcb *pcb, FILLP_INT cntLimit)
|
||||
pcb->send.inSendBytes);
|
||||
pcb->send.inSendBytes = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#if FILLP_ADHOC_PACK_ENABLE
|
||||
@ -385,8 +374,6 @@ static void FillpSendAdhocpack(struct FillpPcb *pcb)
|
||||
pack.lostSeq = pcb->recv.seqNum;
|
||||
|
||||
FillpBuildAndSendPack(pcb, ftSock, &pack, sizeof(struct FillpPktPack) - FILLP_HLEN);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -449,8 +436,6 @@ void FillpUploadRecvBox(struct FillpPcb *pcb)
|
||||
#endif
|
||||
}
|
||||
} while (needLoopRun);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpSendRepaetNack(struct FillpPcb *pcb, struct FillpPktNack *nack)
|
||||
@ -478,7 +463,6 @@ static void FillpSendRepaetNack(struct FillpPcb *pcb, struct FillpPktNack *nack)
|
||||
pcb->statistics.debugPcb.nackSend++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpSendNack(struct FillpPcb *pcb, FILLP_UINT32 startPktNum, FILLP_UINT32 endPktNum)
|
||||
@ -522,8 +506,6 @@ void FillpSendNack(struct FillpPcb *pcb, FILLP_UINT32 startPktNum, FILLP_UINT32
|
||||
}
|
||||
|
||||
FillpFcRecvLost(pcb, lostPktNum);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpAddNodeAtDelayNackListTail(struct FillpPcb *pcb, FILLP_UINT32 startPktNum, FILLP_UINT32 endPktNum)
|
||||
@ -695,8 +677,6 @@ void FillpDataToStack(struct FillpPcb *pcb, struct FillpPcbItem *item)
|
||||
pcb->recv.recvBytes += item->dataLen;
|
||||
|
||||
FillpUploadRecvBox(pcb);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpAjustTlpParameterByRtt(struct FillpPcb *pcb, FILLP_LLONG rtt)
|
||||
@ -747,7 +727,6 @@ static void FillpCalPackInterval(struct FillpPcb *pcb)
|
||||
FILLP_LOGDTL("fillp_sock_id:%d, packInterval:%u, fcTime:%u, RTT:%llu, minPackInterval:%u, retransmitRTO:%llu",
|
||||
FILLP_GET_SOCKET(pcb)->index, pcb->packTimerNode.interval, pcb->FcTimerNode.interval, pcb->rtt,
|
||||
packInterval, pcb->send.retramistRto);
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpCalNackDelayTimeByPackInterval(struct FillpPcb *pcb)
|
||||
|
@ -485,9 +485,7 @@ void FillpConnReqAckInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FillpSendConnConfirm(pcb, &reqAck);
|
||||
return;
|
||||
}
|
||||
|
||||
static FILLP_INT FillpInitNewPcbByNewConn(struct FtNetconn *newConn, FILLP_SIZE_T maxSendCache,
|
||||
@ -809,7 +807,6 @@ void FillpConnConfirmInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p, s
|
||||
return;
|
||||
}
|
||||
FillpProcessConnConfirm(pcb, p, confirm, conn, inst);
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpHandleConnConfirmAckInput(struct FtSocket *sock, struct FtNetconn *conn, struct FillpPcb *pcb,
|
||||
@ -969,8 +966,6 @@ static void FillpCheckandcopyConfirmAckAddr(struct FillpPcb *fpcb,
|
||||
|
||||
(void)memcpy_s(&spcb->localAddr, sizeof(struct sockaddr_in6), &confirmAck->remoteAddr,
|
||||
sizeof(struct sockaddr_in6));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static FILLP_BOOL FillpCheckConfirmAckPar(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p)
|
||||
@ -1089,7 +1084,6 @@ void FillpConnConfirmAckInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p
|
||||
conn->clientFourHandshakeState = FILLP_CLIENT_FOUR_HANDSHAKE_STATE_CONFIRMACK_RCVED;
|
||||
FILLP_LOGDBG("FillpConnConfirmAckInput: fillp_sock_id:%d, initial_send_rate = %u", FILLP_GET_SOCKET(pcb)->index,
|
||||
pcb->send.flowControl.sendRate);
|
||||
return;
|
||||
}
|
||||
|
||||
static void ConnectingHandleFinInput(struct FillpPcb *pcb, struct FtSocket *sock,
|
||||
@ -1139,7 +1133,6 @@ static void FillpStateClosingHandleFinInput(struct FillpPcb *pcb, struct FtNetco
|
||||
|
||||
*pcbFreed = FILLP_TRUE;
|
||||
SpungeConnClosed(conn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1180,7 +1173,6 @@ static void FillpFinInputTrace(FILLP_CONST struct FtSocket *sock, FILLP_CONST st
|
||||
FILLP_LM_FILLPMSGTRACE_OUTPUT_WITHOUT_FT_TRACE_ENABLE_FLAG(FILLP_TRACE_DIRECT_NETWORK, sock->traceHandle,
|
||||
sizeof(struct FillpPktFin), sock->index, fillpTrcDesc, (FILLP_CHAR *)(&tmpFinPkt));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static FILLP_INT FillpHandleFinFlagGet(FILLP_CONST struct NetBuf *p, struct FillpFinFlags *flags)
|
||||
@ -1342,7 +1334,6 @@ void FillpFinInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p, FILLP_BOO
|
||||
}
|
||||
|
||||
FillpHandleFin(pcb, p, pcbFreed);
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpSendConnReqBuild(struct FillpPcb *pcb, struct FillpPktConnReq *req, FILLP_LLONG curTime)
|
||||
@ -1756,8 +1747,6 @@ void FillpSendConnConfirmAck(struct FillpPcb *pcb)
|
||||
pcb->statistics.debugPcb.connConfirmAckSend++;
|
||||
pcb->connTimestamp = SYS_ARCH_GET_CUR_TIME_LONGLONG();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpSendFinBuild(FILLP_CONST struct FillpPcb *pcb, struct FillpPktFin *req,
|
||||
@ -1897,18 +1886,7 @@ void FillpSendRst(struct FillpPcb *pcb, struct sockaddr *remoteAddr)
|
||||
}
|
||||
|
||||
|
||||
/* *****************************************************************************
|
||||
Function : FillpGenerateCookie
|
||||
|
||||
Description : This function Generates the cookieContent for fillp on receiving
|
||||
Connection request from peer.
|
||||
|
||||
Input :
|
||||
Output : NONE
|
||||
|
||||
|
||||
Return : FILLP_SUCCESS/FILLP_FAILURE
|
||||
***************************************************************************** */
|
||||
/* This function Generates the cookieContent for fillp on receiving Connection request from peer. */
|
||||
void FillpGenerateCookie(IN FILLP_CONST struct FillpPcb *pcb, IN struct FillpPktConnReq *req,
|
||||
IN FILLP_CONST struct sockaddr_in6 *remoteAddr, IN FILLP_UINT16 serverPort, OUT FillpCookieContent *stateCookie)
|
||||
{
|
||||
@ -2014,19 +1992,7 @@ static FILLP_INT FillpValidateCookieHmac(FILLP_CONST struct FillpPcb *pcb, FILL
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/* *****************************************************************************
|
||||
Function : FillpValidateCookie
|
||||
|
||||
Description : This function validates the cookieContent from peer.
|
||||
|
||||
Input :
|
||||
Output : NONE
|
||||
|
||||
|
||||
Return : FILLP_SUCCESS/FILLP_FAILURE
|
||||
Modify : Change prototype to include usClientPort
|
||||
|
||||
***************************************************************************** */
|
||||
/* This function validates the cookieContent from peer. */
|
||||
FILLP_INT FillpValidateCookie(IN FILLP_CONST struct FillpPcb *pcb, IN FILLP_UINT16 serverPort,
|
||||
IN FILLP_CONST struct sockaddr_in6 *clientAddr, IN FILLP_CONST FillpCookieContent *stateCookie)
|
||||
{
|
||||
|
@ -185,8 +185,6 @@ void FillpCalSendInterval(struct FillpPcb *pcb)
|
||||
|
||||
pcb->sendTimerNode.interval = (FILLP_UINT32)(flowControl->sendInterval / FILLP_FC_IN_BIT);
|
||||
FILLP_LOGDBG("Send interval %lld, timer_interval:%u", flowControl->sendInterval, pcb->sendTimerNode.interval);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpFcTailProtected(struct FillpPcb *pcb, struct FillpPktPack *pack)
|
||||
@ -231,8 +229,6 @@ void FillpFcTailProtected(struct FillpPcb *pcb, struct FillpPktPack *pack)
|
||||
pcb->send.tailProtect.samePackCount = FILLP_NULL;
|
||||
pcb->send.tailProtect.lastPackSeq = ackSeqNum;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpFcPackInput(struct FillpPcb *pcb, struct FillpPktPack *pack)
|
||||
@ -244,8 +240,6 @@ void FillpFcPackInput(struct FillpPcb *pcb, struct FillpPktPack *pack)
|
||||
if (!(pack->flag & FILLP_PACK_FLAG_REQURE_RTT)) {
|
||||
FillpFcTailProtected(pcb, pack);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpFcNackInput(struct FillpPcb *pcb, struct FillpPktNack *nack)
|
||||
@ -342,8 +336,6 @@ void FillpFcDataInput(struct FillpPcb *pcb, FILLP_CONST struct FillpPktHead *pkt
|
||||
pcb->statistics.traffic.totalRecvedBytes += ((FILLP_UINT32)pkt->dataLen);
|
||||
pcb->statistics.pack.periodRecvedOnes++;
|
||||
pcb->statistics.pack.periodRecvBits += FILLP_FC_VAL_IN_BITS((FILLP_ULLONG)pkt->dataLen);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* discard a data packet */
|
||||
@ -351,24 +343,18 @@ void FillpFcRecvDropOne(struct FillpPcb *pcb)
|
||||
{
|
||||
pcb->statistics.pack.periodDroped++;
|
||||
pcb->statistics.traffic.totalDroped++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* recv an packet outof order */
|
||||
void FillpFcRecvOutOfOrder(struct FillpPcb *pcb)
|
||||
{
|
||||
pcb->statistics.traffic.totalOutOfOrder++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* calculate the lost packets on recv side */
|
||||
void FillpFcRecvLost(struct FillpPcb *pcb, FILLP_UINT32 ones)
|
||||
{
|
||||
pcb->statistics.traffic.totalRecvLost += ones;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpFcCycle(void *arg)
|
||||
@ -405,8 +391,6 @@ void FillpFcCycle(void *arg)
|
||||
FILLP_LOGDTL("update the keep alive interval to %u, fillp_sock_id:%d, detaTime:%lld, keepAliveTime:%u(ms)",
|
||||
pcb->keepAliveTimerNode.interval, sock->index, detaTime, sock->resConf.common.keepAliveTime);
|
||||
FillpEnableKeepAliveTimer(pcb);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -498,7 +498,6 @@ static void FillpNackInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p)
|
||||
}
|
||||
pcb->statistics.debugPcb.nackRcv++;
|
||||
FillpFcNackInput(pcb, nack);
|
||||
return;
|
||||
}
|
||||
|
||||
static FILLP_BOOL FillpCheckPackInput(struct FillpPcb *pcb, FILLP_CONST struct NetBuf *p)
|
||||
|
@ -46,7 +46,6 @@ static void FillpMoveRedundantItemToUnrecvList(struct FillpPcb *pcb)
|
||||
}
|
||||
item = (struct FillpPcbItem *)SkipListPopValue(&sendPcb->redunList);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static struct FillpPcbItem *FillpGetSendItem(struct FillpSendPcb *sendPcb, struct FillpPcb *pcb)
|
||||
|
@ -63,7 +63,7 @@ static FILLP_INT FillpInitSendpcbUnackList(struct FillpSendPcb *pcb)
|
||||
pcb->unackList.hashMap =
|
||||
(struct Hlist *)SpungeAlloc(pcb->unackList.size, sizeof(struct Hlist), SPUNGE_ALLOC_TYPE_CALLOC);
|
||||
if (pcb->unackList.hashMap == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("Failed to allocate memory for hash map \r\n");
|
||||
FILLP_LOGERR("Failed to allocate memory for hash map");
|
||||
|
||||
SkiplistDestroy(&pcb->unrecvList);
|
||||
return ERR_NOBUFS;
|
||||
@ -132,26 +132,26 @@ static FILLP_INT InitSendPcbSimplePar(struct FillpPcb *fpcb)
|
||||
struct FillpSendPcb *pcb = &fpcb->send;
|
||||
FILLP_INT ret;
|
||||
if (fpcb->mpSendSize == 0) {
|
||||
FILLP_LOGERR("FillpInitSendpcb:fpcb->mpSendSize is zero \r\n");
|
||||
FILLP_LOGERR("FillpInitSendpcb:fpcb->mpSendSize is zero");
|
||||
return ERR_NOBUFS;
|
||||
}
|
||||
|
||||
ret = SkiplistInit(&pcb->unrecvList, FillpSkiplistCmp);
|
||||
if (ret != ERR_OK) {
|
||||
FILLP_LOGERR("FillpInitSendpcb:SkiplistInit fails \r\n");
|
||||
FILLP_LOGERR("FillpInitSendpcb:SkiplistInit fails");
|
||||
return ERR_COMM;
|
||||
}
|
||||
|
||||
ret = SkiplistInit(&pcb->itemWaitTokenLists, FillpSkiplistCmp);
|
||||
if (ret != ERR_OK) {
|
||||
FILLP_LOGERR("SkiplistInit redunList fails \r\n");
|
||||
FILLP_LOGERR("SkiplistInit redunList fails");
|
||||
SkiplistDestroy(&pcb->unrecvList);
|
||||
return ERR_COMM;
|
||||
}
|
||||
|
||||
ret = SkiplistInit(&pcb->redunList, FillpSkiplistCmp);
|
||||
if (ret != ERR_OK) {
|
||||
FILLP_LOGERR("SkiplistInit redunList fails \r\n");
|
||||
FILLP_LOGERR("SkiplistInit redunList fails");
|
||||
SkiplistDestroy(&pcb->unrecvList);
|
||||
SkiplistDestroy(&pcb->itemWaitTokenLists);
|
||||
return ERR_COMM;
|
||||
@ -271,7 +271,7 @@ static FILLP_INT FillpInitSendpcb(struct FillpPcb *fpcb)
|
||||
#ifdef SOCK_SEND_SEM
|
||||
ret = SYS_ARCH_SEM_INIT(&pcb->sendSem, (FILLP_ULONG)initCacheSize);
|
||||
if (ret != FILLP_OK) {
|
||||
FILLP_LOGERR("FillpInitSendpcb:SYS_ARCH_SEM_INIT fails \r\n");
|
||||
FILLP_LOGERR("FillpInitSendpcb:SYS_ARCH_SEM_INIT fails");
|
||||
|
||||
SpungeFree(pcb->unackList.hashMap, SPUNGE_ALLOC_TYPE_CALLOC);
|
||||
pcb->unackList.hashMap = FILLP_NULL_PTR;
|
||||
@ -443,8 +443,6 @@ static void FillpInitStastics(struct FillpPcb *fpcb)
|
||||
pcb->appFcStastics.periodSendPktLossHighPrecision = 0;
|
||||
pcb->appFcStastics.periodSendBits = 0;
|
||||
pcb->appFcStastics.periodSendRateBps = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpPcbFreeRecvItemArray(struct FillpRecvPcb *pcb)
|
||||
@ -632,15 +630,6 @@ static void FillpPcbRemoveSend(struct FillpPcb *fpcb)
|
||||
return;
|
||||
}
|
||||
|
||||
static void FillpPcbRemoveStastics(struct FillpPcb *fpcb)
|
||||
{
|
||||
struct FillpStatisticsPcb *pcb = &fpcb->statistics;
|
||||
|
||||
(void)pcb;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpPcbRemoveTimers(struct FillpPcb *fpcb)
|
||||
{
|
||||
/* Remove if any send/pack timer is running on this socket */
|
||||
@ -737,7 +726,6 @@ void FillpRemovePcb(struct FillpPcb *pcb)
|
||||
|
||||
FillpPcbRemoveRecv(pcb);
|
||||
FillpPcbRemoveSend(pcb);
|
||||
FillpPcbRemoveStastics(pcb);
|
||||
FillpPcbRemoveTimers(pcb);
|
||||
FillpFcDeinit(pcb);
|
||||
|
||||
|
@ -46,7 +46,6 @@ void FillpMacTimerExpire(
|
||||
}
|
||||
|
||||
macInfo->switchOverTime = (FILLP_ULLONG)curTime;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,8 +62,6 @@ static void FillpCleanSedata(void *ptr, size_t len, struct SpungeInstance *pcbIn
|
||||
}
|
||||
|
||||
pcbInst->cleanseDataCtr = (FILLP_UINT8)ctr;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpHmacSha256Init(OUT FillpHmacSha256 ctx[1], IN FILLP_UINT8 *key, FILLP_UINT32 klen,
|
||||
@ -122,8 +120,6 @@ void FillpHmacSha256Init(OUT FillpHmacSha256 ctx[1], IN FILLP_UINT8 *key, FILLP_
|
||||
FillpCleanSedata((void *)tk, sizeof(tk), pcbInst);
|
||||
FillpCleanSedata((void *)keyIpad, sizeof(keyIpad), pcbInst);
|
||||
FillpCleanSedata((void *)keyOpad, sizeof(keyOpad), pcbInst);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -147,8 +143,6 @@ void FillpHmacSha256Update(IO FillpHmacSha256 ctx[1], FILLP_CONST FILLP_UINT8 *d
|
||||
} else {
|
||||
FillpSha256Upd(tempCtx->hashki, data, dlen);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpHmacSha256Final(IO FillpHmacSha256 ctx[1],
|
||||
@ -168,8 +162,6 @@ void FillpHmacSha256Final(IO FillpHmacSha256 ctx[1],
|
||||
FillpSha256Fin(tempCtx->hashki, digest, size);
|
||||
FillpSha256Upd(tempCtx->hashko, digest, size);
|
||||
FillpSha256Fin(tempCtx->hashko, digest, size);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +42,6 @@ static void NetconnFreeOsSocket(struct SockOsSocket *osSock, struct SpungeInstan
|
||||
HlistDelete(&curInst->osSockist, &osSock->osListNode);
|
||||
SpungeFree(osSock, SPUNGE_ALLOC_TYPE_CALLOC);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +49,6 @@ void NetconnSetSock(struct FtSocket *sock, struct FtNetconn *conn)
|
||||
{
|
||||
sock->netconn = conn;
|
||||
conn->sock = (void *)sock;
|
||||
return;
|
||||
}
|
||||
|
||||
void NetconnSetSendCacheSize(struct FtNetconn *conn, FILLP_UINT32 cacheSize)
|
||||
@ -154,7 +152,6 @@ void FillpNetconnDestroy(struct FtNetconn *conn)
|
||||
int i;
|
||||
if (conn == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("FillpNetconnDestroy: Invalid paramaters passed\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -173,7 +170,6 @@ void FillpNetconnDestroy(struct FtNetconn *conn)
|
||||
}
|
||||
|
||||
DympFree(conn);
|
||||
return;
|
||||
}
|
||||
|
||||
static FILLP_BOOL FillpErrIsFatal(FILLP_INT err)
|
||||
@ -271,7 +267,6 @@ void FillpNetconnSetState(struct FtNetconn *conn, FILLP_UINT8 state)
|
||||
SpungeTokenBucketDelFpcb(&conn->pcb->fpcb);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -35,7 +35,7 @@ static FILLP_INT SpungePcbRecv(void *argConn, void **buf, FILLP_INT count)
|
||||
struct FtSocket *sock = (struct FtSocket *)conn->sock;
|
||||
FillpErrorType err = FillpQueuePush(conn->pcb->fpcb.recv.recvBox, buf, FILLP_TRUE, (FILLP_UINT)count);
|
||||
if (err) {
|
||||
FILLP_LOGERR("SpungePcbRecv: FillpQueuePush failed. sockId =%d \r\n", sock->index);
|
||||
FILLP_LOGERR("SpungePcbRecv: FillpQueuePush failed. sockId =%d", sock->index);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -295,8 +295,7 @@ void SpungePcbRemove(struct SpungePcb *pcb)
|
||||
struct FtNetconn *conn = FILLP_NULL_PTR;
|
||||
struct SockOsSocket *osSock = FILLP_NULL_PTR;
|
||||
if (pcb == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("SpungePcbRemove: Invalid parameters passed \r\n");
|
||||
|
||||
FILLP_LOGERR("SpungePcbRemove: Invalid parameters passed");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -312,8 +311,6 @@ void SpungePcbRemove(struct SpungePcb *pcb)
|
||||
}
|
||||
|
||||
SpungeFree(pcb, SPUNGE_ALLOC_TYPE_CALLOC);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -163,8 +163,6 @@ static void FillpSha256Compile(FillpSha256Ctx ctx[1])
|
||||
for (jdex = 0; jdex < FILLP_HASH_ARRAY_SZ; jdex++) {
|
||||
ctx->hash[jdex] += hash[jdex];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpSha256Set(FillpSha256Ctx ctx[1])
|
||||
@ -175,8 +173,6 @@ void FillpSha256Set(FillpSha256Ctx ctx[1])
|
||||
if (err != EOK) {
|
||||
FILLP_LOGERR("FillpSha256Set memcpy_s hash failed : %d", err);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -212,8 +208,6 @@ void FillpSha256Upd(FillpSha256Ctx ctx[1], const FILLP_UINT8 data[], size_t len)
|
||||
FILLP_LOGERR("FillpSha256Upd memcpy_s 2 failed : %d, freeSize = %u, len = %zu", err, freeSize, len);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FillpSha256Fin(FillpSha256Ctx ctx[1], FILLP_UINT8 hashVal[], FILLP_UINT32 hashValLen)
|
||||
@ -256,8 +250,6 @@ void FillpSha256Fin(FillpSha256Ctx ctx[1], FILLP_UINT8 hashVal[], FILLP_UINT32 h
|
||||
shfBits = (FILLP_SHA_EIGHT_PAR * (~offset & FILLP_SHA_THREE_PAR));
|
||||
hashVal[offset] = (FILLP_UINT8)(ctx->hash[offset >> FILLP_SHA_TWO_PAR] >> shfBits);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -480,7 +480,7 @@ static int SpungeAllocInstRes(void)
|
||||
if (err == ERR_OK) {
|
||||
continue;
|
||||
}
|
||||
FILLP_LOGERR("SpungeInstInit failed :: Instance number :: %u\r\n", i);
|
||||
FILLP_LOGERR("SpungeInstInit failed :: Instance number :: %u", i);
|
||||
|
||||
/* Release instances which are created success */
|
||||
if (i > 0) {
|
||||
@ -628,7 +628,7 @@ static FILLP_INT FtInitGlobalSockTable(void)
|
||||
{
|
||||
g_spunge->sockTable = SpungeCreateSockTable(g_spunge->resConf.maxSockNum);
|
||||
if (g_spunge->sockTable == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("Malloc g_spunge->sockTable failed\r\n");
|
||||
FILLP_LOGERR("Malloc g_spunge->sockTable failed");
|
||||
return ERR_NORES;
|
||||
}
|
||||
return ERR_OK;
|
||||
@ -646,7 +646,7 @@ static FILLP_INT FtInitGlobalNetPool(void)
|
||||
g_spunge->netPool = DympCreatePool((FILLP_INT)netPoolInitSize, (int)g_spunge->resConf.maxConnNum,
|
||||
sizeof(struct FtNetconn), FILLP_TRUE, &itemOperaCb);
|
||||
if (g_spunge->netPool == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("Malloc g_spunge->netPool failed\r\n");
|
||||
FILLP_LOGERR("Malloc g_spunge->netPool failed");
|
||||
return ERR_NORES;
|
||||
}
|
||||
|
||||
@ -755,12 +755,12 @@ FILLP_INT FtInit(void)
|
||||
}
|
||||
|
||||
if (SpungeCheckCallbacks() != ERR_OK) {
|
||||
FILLP_LOGERR("User has not registered system callback functions \r\n");
|
||||
FILLP_LOGERR("User has not registered system callback functions");
|
||||
return ERR_ADP_SYS_CALLBACK_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
if (SYS_ARCH_INIT() != ERR_OK) {
|
||||
FILLP_LOGERR("SYS_ARCH_INIT ssp failed \r\n");
|
||||
FILLP_LOGERR("SYS_ARCH_INIT ssp failed");
|
||||
return ERR_NORES;
|
||||
}
|
||||
|
||||
@ -1390,7 +1390,6 @@ static void SpungeClearItemWaitTokenList(struct SpungeTokenBucke *stb)
|
||||
stb->waitPktCount = 0;
|
||||
}
|
||||
stb->fpcbCur = HLIST_FIRST(&(stb->tbFpcbLists));
|
||||
return;
|
||||
}
|
||||
|
||||
void SpungeCheckItemWaitTokenList(struct SpungeTokenBucke *stb)
|
||||
@ -1633,8 +1632,6 @@ void SpungePushRecvdDataToStack(void *arg)
|
||||
}
|
||||
|
||||
FillpEnableDataBurstTimer(pcb);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -102,8 +102,6 @@ static void SpungeEpollFreeResource(struct FtSocket *sock)
|
||||
(void)SYS_ARCH_ATOMIC_SET(&sock->sendEvent, 0);
|
||||
(void)SYS_ARCH_ATOMIC_SET(&sock->sendEventCount, 0);
|
||||
sock->errEvent = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SpungeFreeAcceptBox(struct FtSocket *sock)
|
||||
@ -138,8 +136,6 @@ void SpungeIncFreeCntPostEagain(struct FtSocket *sock)
|
||||
FILLP_LOGERR("FAILED TO POST -- MSG_TYPE_FREE_SOCK_EAGAIN--- to CORE."
|
||||
"Socket leak can happen : Sock ID: %d\r\n", sock->index);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void RecursiveRbTree(struct RbNode *node)
|
||||
@ -152,7 +148,6 @@ static void RecursiveRbTree(struct RbNode *node)
|
||||
|
||||
if (node == FILLP_NULL_PTR) {
|
||||
FILLP_LOGERR("RecursiveRbTree: Inavild parameters passed.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -186,8 +181,6 @@ static void RecursiveRbTree(struct RbNode *node)
|
||||
if (right != FILLP_NULL_PTR) {
|
||||
RecursiveRbTree(right);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -240,8 +233,8 @@ void SpungEpollClose(struct FtSocket *sock)
|
||||
(void)SYS_ARCH_RWSEM_WRPOST(&sock->sockConnSem);
|
||||
|
||||
(void)FillpQueuePush(g_spunge->sockTable->freeQueqe, (void *)&sock, FILLP_FALSE, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
static void SpungeCloseCBSocket(struct FtSocket *sock)
|
||||
{
|
||||
if ((FILLP_SOCKETCLOSE_CBK != FILLP_NULL_PTR) && (sock->isListenSock == FILLP_FALSE) &&
|
||||
@ -308,8 +301,6 @@ void SpungeFreeSock(struct FtSocket *sock)
|
||||
|
||||
(void)FillpQueuePush(g_spunge->sockTable->freeQueqe, (void *)&sock, FILLP_FALSE, 1);
|
||||
(void)SYS_ARCH_RWSEM_WRPOST(&sock->sockConnSem);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SpungeShutdownSock(void *argSock, FILLP_INT how)
|
||||
@ -456,7 +447,6 @@ void SpungeCheckDisconn(void *argConn)
|
||||
|
||||
TIMER_REPEAT:
|
||||
FillpEnableFinCheckTimer(pcb);
|
||||
return;
|
||||
}
|
||||
|
||||
void SpungeSendConnectMsg(void *argConn)
|
||||
@ -506,8 +496,6 @@ void SpungeSendConnectMsg(void *argConn)
|
||||
FILLP_PKT_TYPE_CONN_REQ, (void *)osSock->ioSock, (void *)conn->pcb, FILLP_NULL_PTR) == -1) {
|
||||
FILLP_LOGINF("send conn req fail for sockId:%d", sock->index);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SpinstAddToPcbList(struct SpungeInstance *inst, struct HlistNode *node)
|
||||
@ -528,7 +516,6 @@ FillpQueue *SpungeAllocUnsendBox(struct SpungeInstance *inst)
|
||||
void SpungeFreeUnsendBox(struct FillpPcb *pcb)
|
||||
{
|
||||
FILLP_UNUSED_PARA(pcb);
|
||||
return;
|
||||
}
|
||||
|
||||
/* This function is called when the connection is sure closed
|
||||
|
@ -417,8 +417,6 @@ static void SysioAddPcbUdp(void *argSock, void *argPcb)
|
||||
{
|
||||
FILLP_UNUSED_PARA(argSock);
|
||||
FILLP_UNUSED_PARA(argPcb);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -543,7 +541,7 @@ static void SysioConnectedUdp(void *argSock, void *argOsSock)
|
||||
FILLP_LOGDBG("UDP Connect success!!!!");
|
||||
udpSock->connected = FILLP_TRUE;
|
||||
} else {
|
||||
FILLP_LOGINF("UDP Connect Failure !!!!");
|
||||
FILLP_LOGERR("UDP Connect Failure !!!!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,8 +267,6 @@ void FillpMemFree(IN void *addr)
|
||||
if (addr != FILLP_NULL_PTR) {
|
||||
free(addr);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void *FillpMemChr(IN FILLP_CONST void *s, IN FILLP_INT c, IN FILLP_SIZE_T n)
|
||||
@ -356,7 +354,6 @@ FT_FD_SET FillpFuncCreateFdSet(void)
|
||||
void FillpFuncDestroyFdSet(IN FT_FD_SET destroyFdSet)
|
||||
{
|
||||
FillpMemFree(destroyFdSet);
|
||||
return;
|
||||
}
|
||||
|
||||
FILLP_INT32 FillpFuncCopyFdSet(IO FT_FD_SET dstFdSet, IN FT_FD_SET srcFdSet)
|
||||
@ -433,7 +430,7 @@ FILLP_INT FillpCreateThread(IN void *param, IO void *threadId)
|
||||
|
||||
#define FillpSysArchGetCurTime(time) (*(time) = mach_absolute_time())
|
||||
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FillpSysArchTime *time)
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FILLP_CONST FillpSysArchTime *time)
|
||||
{
|
||||
if (g_macTimeBaseInfo.denom == 0) {
|
||||
return 0;
|
||||
@ -446,7 +443,7 @@ FILLP_LLONG FillpSysArchTimeToLonglong(FillpSysArchTime *time)
|
||||
|
||||
#define FillpSysArchGetCurTime(time) (void)clock_gettime(CLOCK_MONOTONIC, time)
|
||||
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FillpSysArchTime *ptime)
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FILLP_CONST FillpSysArchTime *ptime)
|
||||
{
|
||||
FILLP_LLONG l_time = ((FILLP_LLONG)ptime->tv_sec) * FILLP_CONST_1M + (ptime->tv_nsec / FILLP_CONST_1K);
|
||||
return l_time;
|
||||
@ -465,10 +462,9 @@ void FillpSysArchGetCurTime(FillpSysArchTime *timeValue)
|
||||
{
|
||||
/* Windows 2000 and later. ---------------------------------- */
|
||||
QueryPerformanceCounter(&(timeValue->time));
|
||||
return;
|
||||
}
|
||||
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FillpSysArchTime *timeValue)
|
||||
FILLP_LLONG FillpSysArchTimeToLonglong(FILLP_CONST FillpSysArchTime *timeValue)
|
||||
{
|
||||
if (g_fillpBasePerformanceFrequency.QuadPart == 0) {
|
||||
return 0;
|
||||
@ -618,7 +614,6 @@ FILLP_INT FillpSysArchCompAndWwap(
|
||||
void FillpSysSleepMs(IN FILLP_UINT timeValue) /* In Millseconds */
|
||||
{
|
||||
FILLP_ADP_SLEEP_MS(timeValue);
|
||||
return;
|
||||
}
|
||||
|
||||
FILLP_INT FillpSysSleepUs(IN FILLP_UINT timeValue) /* In micro seconds */
|
||||
|
@ -43,8 +43,6 @@ void EpollUpdateEpEvent(struct EpItem *epi)
|
||||
} else {
|
||||
epi->revents &= (FILLP_UINT32)(~SPUNGE_EPOLLOUT);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,8 +83,6 @@ void EpollEventCallback(struct FtSocket *sock, FILLP_UINT32 upEvent)
|
||||
}
|
||||
|
||||
(void)SYS_ARCH_SEM_POST(&sock->epollTaskListLock);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct GlobalAppResource g_appResource = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user