Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
ec2ace4f
Commit
ec2ace4f
authored
Mar 31, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generalise find_request, split.
parent
f2778e5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
resend.c
resend.c
+20
-12
No files found.
resend.c
View file @
ec2ace4f
...
...
@@ -37,33 +37,41 @@ struct timeval resend_time = {0, 0};
struct
resend
*
to_resend
=
NULL
;
static
int
re
quest_match
(
struct
resend
*
request
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
re
send_match
(
struct
resend
*
resend
,
int
kind
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
{
return
request
->
plen
==
plen
&&
memcmp
(
request
->
prefix
,
prefix
,
16
)
==
0
;
return
(
resend
->
kind
==
kind
&&
resend
->
plen
==
plen
&&
memcmp
(
resend
->
prefix
,
prefix
,
16
)
==
0
);
}
struct
resend
*
find_re
quest
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
st
atic
st
ruct
resend
*
find_re
send
(
int
kind
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
resend
**
previous_return
)
{
struct
resend
*
reques
t
,
*
previous
;
struct
resend
*
curren
t
,
*
previous
;
previous
=
NULL
;
reques
t
=
to_resend
;
while
(
reques
t
)
{
if
(
re
quest_match
(
request
,
prefix
,
plen
))
{
curren
t
=
to_resend
;
while
(
curren
t
)
{
if
(
re
send_match
(
current
,
kind
,
prefix
,
plen
))
{
if
(
previous_return
)
*
previous_return
=
previous
;
return
reques
t
;
return
curren
t
;
}
previous
=
reques
t
;
request
=
reques
t
->
next
;
previous
=
curren
t
;
current
=
curren
t
->
next
;
}
return
NULL
;
}
struct
resend
*
find_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
resend
**
previous_return
)
{
return
find_resend
(
RESEND_REQUEST
,
prefix
,
plen
,
previous_return
);
}
int
record_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment