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
1eeccee1
Commit
1eeccee1
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
More beautification of trash can entries and details (for log messages)
parent
0db27c20
No related branches found
No related tags found
No related merge requests found
Pipeline
#5008
failed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/trash.c
+15
-10
15 additions, 10 deletions
src/sbbs3/trash.c
with
15 additions
and
10 deletions
src/sbbs3/trash.c
+
15
−
10
View file @
1eeccee1
...
...
@@ -63,8 +63,11 @@ char* trash_details(const struct trash* trash, char* str, size_t max)
char
tmp
[
64
];
char
since
[
128
]
=
""
;
*
str
=
'\0'
;
if
(
trash
->
added
)
snprintf
(
since
,
sizeof
since
,
"since %.24s"
,
ctime_r
(
&
trash
->
added
,
tmp
));
if
(
trash
->
added
)
{
char
*
p
=
ctime_r
(
&
trash
->
added
,
tmp
);
if
(
p
!=
NULL
)
snprintf
(
since
,
sizeof
since
,
"since %.20s"
,
p
+
4
);
}
snprintf
(
str
,
max
,
"%s%s%s%s%s"
,
since
,
trash
->
reason
[
0
]
?
" for "
:
""
,
trash
->
reason
...
...
@@ -153,17 +156,19 @@ BOOL filter_ip(scfg_t* cfg, const char* prot, const char* reason, const char* ho
if
((
fp
=
fnopen
(
NULL
,
fname
,
O_CREAT
|
O_APPEND
|
O_WRONLY
))
==
NULL
)
return
(
FALSE
);
fprintf
(
fp
,
"%s
\t
t=%s
\t
p=%s
\t
r=%s
"
fprintf
(
fp
,
"%s
\t
t=%s"
,
ip_addr
,
time_to_isoDateTimeStr
(
now
,
xpTimeZone_local
(),
tstr
,
sizeof
tstr
)
,
prot
,
reason
);
if
(
duration
)
,
time_to_isoDateTimeStr
(
now
,
xpTimeZone_local
(),
tstr
,
sizeof
tstr
));
if
(
prot
!=
NULL
&&
*
prot
!=
'\0'
)
fprintf
(
fp
,
"
\t
p=%s"
,
prot
);
if
(
reason
!=
NULL
&&
*
reason
!=
'\0'
)
fprintf
(
fp
,
"
\t
r=%s"
,
reason
);
if
(
duration
>
0
)
fprintf
(
fp
,
"
\t
e=%s"
,
time_to_isoDateTimeStr
(
time
(
NULL
)
+
duration
,
xpTimeZone_local
(),
tstr
,
sizeof
tstr
));
if
(
host
!=
NULL
&&
strcmp
(
host
,
STR_NO_HOSTNAME
)
!=
0
)
fprintf
(
fp
,
"
\t
h=%s"
,
host
);
if
(
username
!=
NULL
)
if
(
username
!=
NULL
&&
*
username
!=
'\0'
)
fprintf
(
fp
,
"
\t
u=%s"
,
username
);
if
(
host
!=
NULL
&&
*
host
!=
'\0'
&&
strcmp
(
host
,
STR_NO_HOSTNAME
)
!=
0
)
fprintf
(
fp
,
"
\t
h=%s"
,
host
);
fputc
(
'\n'
,
fp
);
fclose
(
fp
);
...
...
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