Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
a52caeb2
Commit
a52caeb2
authored
Oct 25, 2004
by
Ed "oddsock" Zaleski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix line endings...
svn path=/icecast/trunk/icecast/; revision=8096
parent
000a33b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
59 deletions
+59
-59
src/logging.c
src/logging.c
+59
-59
No files found.
src/logging.c
View file @
a52caeb2
...
...
@@ -37,60 +37,60 @@
/* the global log descriptors */
int
errorlog
=
0
;
int
accesslog
=
0
;
#ifdef _WIN32
/* Since strftime's %z option on win32 is different, we need
to go through a few loops to get the same info as %z */
int
get_clf_time
(
char
*
buffer
,
unsigned
len
,
struct
tm
*
t
)
{
char
sign
;
char
*
timezone_string
;
struct
tm
gmt
;
time_t
time1
=
time
(
NULL
);
int
time_days
,
time_hours
,
time_tz
;
int
tempnum1
,
tempnum2
;
struct
tm
*
thetime
;
time_t
now
;
gmtime_r
(
&
time1
,
&
gmt
);
time_days
=
t
->
tm_yday
-
gmt
.
tm_yday
;
if
(
time_days
<
-
1
)
{
tempnum1
=
24
;
}
else
{
tempnum1
=
1
;
}
if
(
tempnum1
<
time_days
)
{
tempnum2
=
-
24
;
}
else
{
tempnum2
=
time_days
*
24
;
}
time_hours
=
(
tempnum2
+
t
->
tm_hour
-
gmt
.
tm_hour
);
time_tz
=
time_hours
*
60
+
t
->
tm_min
-
gmt
.
tm_min
;
if
(
time_tz
<
0
)
{
sign
=
'-'
;
time_tz
=
-
time_tz
;
}
else
{
sign
=
'+'
;
}
timezone_string
=
calloc
(
1
,
7
);
snprintf
(
timezone_string
,
7
,
" %c%.2d%.2d"
,
sign
,
time_tz
/
60
,
time_tz
%
60
);
now
=
time
(
NULL
);
thetime
=
localtime
(
&
now
);
strftime
(
buffer
,
len
-
7
,
"%d/%b/%Y:%H:%M:%S"
,
thetime
);
strcat
(
buffer
,
timezone_string
);
return
1
;
}
#ifdef _WIN32
/* Since strftime's %z option on win32 is different, we need
to go through a few loops to get the same info as %z */
int
get_clf_time
(
char
*
buffer
,
unsigned
len
,
struct
tm
*
t
)
{
char
sign
;
char
*
timezone_string
;
struct
tm
gmt
;
time_t
time1
=
time
(
NULL
);
int
time_days
,
time_hours
,
time_tz
;
int
tempnum1
,
tempnum2
;
struct
tm
*
thetime
;
time_t
now
;
gmtime_r
(
&
time1
,
&
gmt
);
time_days
=
t
->
tm_yday
-
gmt
.
tm_yday
;
if
(
time_days
<
-
1
)
{
tempnum1
=
24
;
}
else
{
tempnum1
=
1
;
}
if
(
tempnum1
<
time_days
)
{
tempnum2
=
-
24
;
}
else
{
tempnum2
=
time_days
*
24
;
}
time_hours
=
(
tempnum2
+
t
->
tm_hour
-
gmt
.
tm_hour
);
time_tz
=
time_hours
*
60
+
t
->
tm_min
-
gmt
.
tm_min
;
if
(
time_tz
<
0
)
{
sign
=
'-'
;
time_tz
=
-
time_tz
;
}
else
{
sign
=
'+'
;
}
timezone_string
=
calloc
(
1
,
7
);
snprintf
(
timezone_string
,
7
,
" %c%.2d%.2d"
,
sign
,
time_tz
/
60
,
time_tz
%
60
);
now
=
time
(
NULL
);
thetime
=
localtime
(
&
now
);
strftime
(
buffer
,
len
-
7
,
"%d/%b/%Y:%H:%M:%S"
,
thetime
);
strcat
(
buffer
,
timezone_string
);
return
1
;
}
#endif
/*
** ADDR USER AUTH DATE REQUEST CODE BYTES REFERER AGENT [TIME]
...
...
@@ -118,12 +118,12 @@ void logging_access(client_t *client)
now
=
time
(
NULL
);
localtime_r
(
&
now
,
&
thetime
);
localtime_r
(
&
now
,
&
thetime
);
/* build the data */
#ifdef _WIN32
memset
(
datebuf
,
'\000'
,
sizeof
(
datebuf
));
get_clf_time
(
datebuf
,
sizeof
(
datebuf
)
-
1
,
&
thetime
);
#else
#ifdef _WIN32
memset
(
datebuf
,
'\000'
,
sizeof
(
datebuf
));
get_clf_time
(
datebuf
,
sizeof
(
datebuf
)
-
1
,
&
thetime
);
#else
strftime
(
datebuf
,
sizeof
(
datebuf
),
LOGGING_FORMAT_CLF
,
&
thetime
);
#endif
/* build the request */
...
...
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