Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
lifenjoiner committed Sep 30, 2024
1 parent aace987 commit a84b794
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
20 changes: 10 additions & 10 deletions mcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand All @@ -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;
Expand All @@ -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
);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions mcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
4 changes: 2 additions & 2 deletions tcpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down
14 changes: 7 additions & 7 deletions udpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion udpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct _UdpM {
EFFECTIVE_LOCK Lock;

ThreadHandle WorkThread;
ThreadHandle SwepThread;
ThreadHandle SweepThread;

int IsServer;

Expand Down

0 comments on commit a84b794

Please sign in to comment.