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
Show 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};
...
@@ -37,33 +37,41 @@ struct timeval resend_time = {0, 0};
struct
resend
*
to_resend
=
NULL
;
struct
resend
*
to_resend
=
NULL
;
static
int
static
int
re
quest_match
(
struct
resend
*
request
,
re
send_match
(
struct
resend
*
resend
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
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
*
st
atic
st
ruct
resend
*
find_re
quest
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
find_re
send
(
int
kind
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
resend
**
previous_return
)
struct
resend
**
previous_return
)
{
{
struct
resend
*
reques
t
,
*
previous
;
struct
resend
*
curren
t
,
*
previous
;
previous
=
NULL
;
previous
=
NULL
;
reques
t
=
to_resend
;
curren
t
=
to_resend
;
while
(
reques
t
)
{
while
(
curren
t
)
{
if
(
re
quest_match
(
request
,
prefix
,
plen
))
{
if
(
re
send_match
(
current
,
kind
,
prefix
,
plen
))
{
if
(
previous_return
)
if
(
previous_return
)
*
previous_return
=
previous
;
*
previous_return
=
previous
;
return
reques
t
;
return
curren
t
;
}
}
previous
=
reques
t
;
previous
=
curren
t
;
request
=
reques
t
->
next
;
current
=
curren
t
->
next
;
}
}
return
NULL
;
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
int
record_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
record_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
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