diff --git a/hosts.c b/hosts.c index 9139694..2da3fed 100755 --- a/hosts.c +++ b/hosts.c @@ -185,7 +185,7 @@ Hosts_SocketLoop(void *Unused) break; } TimeLimit = LongTime; - Context.Swep(&Context, NULL, NULL); + Context.Sweep(&Context, NULL, NULL); } else if( Pulled == InnerSocket ) { /* Recursive query */ diff --git a/mcontext.c b/mcontext.c index c2b0076..52aa723 100755 --- a/mcontext.c +++ b/mcontext.c @@ -3,10 +3,10 @@ #include "mcontext.h" #include "common.h" -static int ModuleContext_Swep_Collect(Bst *t, - const MsgContext *Context, - Array *Pending - ) +static int ModuleContext_Sweep_Collect(Bst *t, + const MsgContext *Context, + Array *Pending + ) { if( time(NULL) - ((IHeader *)Context)->Timestamp > 2 ) { @@ -16,7 +16,7 @@ static int ModuleContext_Swep_Collect(Bst *t, return 0; } -static void ModuleContext_Swep(ModuleContext *c, SwepCallback cb, void *Arg) +static void ModuleContext_Sweep(ModuleContext *c, SweepCallback cb, void *Arg) { Array Pending; int i; @@ -34,7 +34,7 @@ static void ModuleContext_Swep(ModuleContext *c, SwepCallback cb, void *Arg) } c->d.Enum(&(c->d), - (Bst_Enum_Callback)ModuleContext_Swep_Collect, + (Bst_Enum_Callback)ModuleContext_Sweep_Collect, &Pending ); @@ -81,9 +81,9 @@ static void ModuleContext_Del(ModuleContext *c, MsgContext *Input) } static int ModuleContext_GenAnswerHeaderAndRemove(ModuleContext *c, - MsgContext *Input, - MsgContext *Output - ) + MsgContext *Input, + MsgContext *Output + ) { IHeader *h1, *h2; const MsgContext *ri; @@ -150,7 +150,7 @@ int ModuleContext_Init(ModuleContext *c, int ItemLength) c->Del = ModuleContext_Del; c->Find = ModuleContext_Find; c->GenAnswerHeaderAndRemove = ModuleContext_GenAnswerHeaderAndRemove; - c->Swep = ModuleContext_Swep; + c->Sweep = ModuleContext_Sweep; return 0; } diff --git a/mcontext.h b/mcontext.h index 26f1d08..7276967 100755 --- a/mcontext.h +++ b/mcontext.h @@ -5,7 +5,7 @@ #include "iheader.h" #include "bst.h" -typedef void (*SwepCallback)(const MsgContext *MsgCtx, int Number, void *Arg); +typedef void (*SweepCallback)(const MsgContext *MsgCtx, int Number, void *Arg); typedef struct _ModuleContext ModuleContext; @@ -22,7 +22,7 @@ struct _ModuleContext{ MsgContext *Output ); - void (*Swep)(ModuleContext *c, SwepCallback cb, void *Arg); + void (*Sweep)(ModuleContext *c, SweepCallback cb, void *Arg); }; void ModuleContext_Free(ModuleContext *c); diff --git a/mmgr.c b/mmgr.c index e421eb6..116d569 100755 --- a/mmgr.c +++ b/mmgr.c @@ -606,7 +606,7 @@ Modules_SafeCleanup(ModuleMap *ModuleMap) { M->ModuleUnion.Udp.IsServer = 0; InUse |= M->ModuleUnion.Udp.WorkThread != NULL_THREAD; - InUse |= M->ModuleUnion.Udp.SwepThread != NULL_THREAD; + InUse |= M->ModuleUnion.Udp.SweepThread != NULL_THREAD; } else if( strcmp(M->ModuleName, "TCP") == 0 ) { diff --git a/tcpm.c b/tcpm.c index afaa123..d0d4ed7 100755 --- a/tcpm.c +++ b/tcpm.c @@ -571,7 +571,7 @@ TcpM_Works(TcpM *m) ERRORMSG("TcpM fatal error %d.\n", Err); break; } - m->Context.Swep(&(m->Context), (SwepCallback)SweepWorks, m); + m->Context.Sweep(&(m->Context), (SweepCallback)SweepWorks, m); NumberOfCumulated = 0; continue; } @@ -581,7 +581,7 @@ TcpM_Works(TcpM *m) if( NumberOfCumulated > 1024 ) { - m->Context.Swep(&(m->Context), (SwepCallback)SweepWorks, m); + m->Context.Sweep(&(m->Context), (SweepCallback)SweepWorks, m); NumberOfCumulated = 0; } diff --git a/udpm.c b/udpm.c index 7c66147..627f56b 100755 --- a/udpm.c +++ b/udpm.c @@ -22,10 +22,10 @@ static void SweepWorks(MsgContext *MsgCtx, int Number, UdpM *Module) } } -static int SwepTask(UdpM *m, SwepCallback cb) +static int SweepTask(UdpM *m, SweepCallback cb) { EFFECTIVE_LOCK_GET(m->Lock); - m->Context.Swep(&(m->Context), cb, m); + m->Context.Sweep(&(m->Context), cb, m); EFFECTIVE_LOCK_RELEASE(m->Lock); return 0; @@ -35,18 +35,18 @@ static int #ifdef _WIN32 WINAPI #endif -UdpM_Swep_Thread(UdpM *m) +UdpM_Sweep_Thread(UdpM *m) { while( m->IsServer || m->WorkThread != NULL_THREAD) { - SwepTask(m, (SwepCallback)SweepWorks); + SweepTask(m, (SweepCallback)SweepWorks); SLEEP(10000); } ModuleContext_Free(&(m->Context)); EFFECTIVE_LOCK_DESTROY(m->Lock); - m->SwepThread = NULL_THREAD; + m->SweepThread = NULL_THREAD; return 0; } @@ -410,8 +410,8 @@ int UdpM_Init(UdpM *m, const char *Services, BOOL Parallel) CREATE_THREAD(UdpM_Works, m, m->WorkThread); DETACH_THREAD(m->WorkThread); - CREATE_THREAD(UdpM_Swep_Thread, m, m->SwepThread); - DETACH_THREAD(m->SwepThread); + CREATE_THREAD(UdpM_Sweep_Thread, m, m->SweepThread); + DETACH_THREAD(m->SweepThread); return 0; diff --git a/udpm.h b/udpm.h index d8d61ca..77655b9 100755 --- a/udpm.h +++ b/udpm.h @@ -16,7 +16,7 @@ struct _UdpM { EFFECTIVE_LOCK Lock; ThreadHandle WorkThread; - ThreadHandle SwepThread; + ThreadHandle SweepThread; int IsServer;