Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9fd3442f
Commit
9fd3442f
authored
Jun 22, 2008
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ctime1
Originally committed as revision 13864 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
124ed1c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
ffserver.c
ffserver.c
+17
-19
No files found.
ffserver.c
View file @
9fd3442f
...
...
@@ -304,6 +304,20 @@ static AVRandomState random_state;
static
FILE
*
logfile
=
NULL
;
static
char
*
ctime1
(
char
*
buf2
)
{
time_t
ti
;
char
*
p
;
ti
=
time
(
NULL
);
p
=
ctime
(
&
ti
);
strcpy
(
buf2
,
p
);
p
=
buf2
+
strlen
(
p
)
-
1
;
if
(
*
p
==
'\n'
)
*
p
=
'\0'
;
return
buf2
;
}
static
void
__attribute__
((
format
(
printf
,
1
,
2
)))
http_log
(
const
char
*
fmt
,
...)
{
static
int
print_prefix
=
1
;
...
...
@@ -312,11 +326,9 @@ static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ..
if
(
logfile
)
{
if
(
print_prefix
)
{
time_t
current
=
time
(
0
);
char
buffer
[
32
];
strncpy
(
buffer
,
ctime
(
&
current
),
31
);
buffer
[
strlen
(
buffer
)
-
1
]
=
0
;
// remove '\n'
fprintf
(
logfile
,
"%s "
,
buffer
);
char
buf
[
32
];
ctime1
(
buf
);
fprintf
(
logfile
,
"%s "
,
buf
);
}
print_prefix
=
strstr
(
fmt
,
"
\n
"
)
!=
NULL
;
vfprintf
(
logfile
,
fmt
,
ap
);
...
...
@@ -325,20 +337,6 @@ static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ..
va_end
(
ap
);
}
static
char
*
ctime1
(
char
*
buf2
)
{
time_t
ti
;
char
*
p
;
ti
=
time
(
NULL
);
p
=
ctime
(
&
ti
);
strcpy
(
buf2
,
p
);
p
=
buf2
+
strlen
(
p
)
-
1
;
if
(
*
p
==
'\n'
)
*
p
=
'\0'
;
return
buf2
;
}
static
void
log_connection
(
HTTPContext
*
c
)
{
char
buf2
[
32
];
...
...
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