Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
f14c65b8
Commit
f14c65b8
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created configurable retry_delay member of smb_t.
parent
e76c7a6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/smblib/smbdefs.h
+1
-0
1 addition, 0 deletions
src/smblib/smbdefs.h
src/smblib/smblib.c
+9
-6
9 additions, 6 deletions
src/smblib/smblib.c
with
10 additions
and
6 deletions
src/smblib/smbdefs.h
+
1
−
0
View file @
f14c65b8
...
...
@@ -518,6 +518,7 @@ typedef struct { // Message base
FILE
*
sda_fp
;
// File pointer for data allocation (.sda) file
FILE
*
sha_fp
;
// File pointer for header allocation (.sha) file
ulong
retry_time
;
// Maximum number of seconds to retry opens/locks
ulong
retry_delay
;
// Time-slice yield delay while retrying
smbstatus_t
status
;
// Status header record
char
shd_buf
[
SHD_BLOCK_LEN
];
// File I/O buffer for header file
char
last_error
[
128
];
// Last error message
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smblib.c
+
9
−
6
View file @
f14c65b8
...
...
@@ -91,8 +91,11 @@ int SMBCALL smb_open(smb_t* smb)
char
str
[
128
];
smbhdr_t
hdr
;
/* Set default values, if uninitialized */
if
(
!
smb
->
retry_time
)
smb
->
retry_time
=
10
;
if
(
!
smb
->
retry_delay
)
smb
->
retry_delay
=
250
;
smb
->
shd_fp
=
smb
->
sdt_fp
=
smb
->
sid_fp
=
NULL
;
smb
->
last_error
[
0
]
=
0
;
sprintf
(
str
,
"%s.shd"
,
smb
->
file
);
...
...
@@ -220,7 +223,7 @@ int SMBCALL smb_open_da(smb_t* smb)
,
str
,
smb
->
retry_time
);
return
(
-
2
);
}
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
if
((
smb
->
sda_fp
=
fdopen
(
file
,
"r+b"
))
==
NULL
)
{
sprintf
(
smb
->
last_error
,
"%d fdopening %s (%d)"
,
errno
,
str
,
file
);
...
...
@@ -265,7 +268,7 @@ int SMBCALL smb_open_ha(smb_t* smb)
,
str
,
smb
->
retry_time
);
return
(
-
2
);
}
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
if
((
smb
->
sha_fp
=
fdopen
(
file
,
"r+b"
))
==
NULL
)
{
sprintf
(
smb
->
last_error
,
"%d fdopening %s (%d)"
,
errno
,
str
,
file
);
...
...
@@ -359,7 +362,7 @@ int SMBCALL smb_trunchdr(smb_t* smb)
,
smb
->
retry_time
);
return
(
-
2
);
}
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
return
(
0
);
}
...
...
@@ -385,7 +388,7 @@ int SMBCALL smb_locksmbhdr(smb_t* smb)
break
;
/* In case we've already locked it */
unlock
(
fileno
(
smb
->
shd_fp
),
0L
,
sizeof
(
smbhdr_t
)
+
sizeof
(
smbstatus_t
));
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
sprintf
(
smb
->
last_error
,
"timeout locking header"
);
return
(
-
1
);
...
...
@@ -455,7 +458,7 @@ int SMBCALL smb_lockmsghdr(smb_t* smb, smbmsg_t* msg)
break
;
/* In case we've already locked it */
unlock
(
fileno
(
smb
->
shd_fp
),
msg
->
idx
.
offset
,
sizeof
(
msghdr_t
));
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
sprintf
(
smb
->
last_error
,
"timeout locking header"
);
return
(
-
1
);
...
...
@@ -922,7 +925,7 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
,
str
,
smb
->
retry_time
);
return
(
-
2
);
}
mswait
(
1
);
mswait
(
smb
->
retry_delay
);
}
length
=
filelength
(
file
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment