Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
spr0cketeer
Icecast-Server
Commits
4927a110
Commit
4927a110
authored
Oct 10, 2012
by
Philipp Schafft
🦁
Browse files
fixes for win32 (ported 2.3.99.0 patches). Thanks to LRN (from Mailing list).
svn path=/icecast/trunk/icecast/; revision=18642
parent
8e0777a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure.in
View file @
4927a110
...
...
@@ -34,8 +34,9 @@ AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([alloca.h sys/timeb.h])
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
AC_CHECK_HEADERS([pwd.h, unistd.h, grp.h, sys/types.h])
AC_CHECK_FUNC([chuid])
AC_CHECK_FUNC([chown])
dnl Checks for typedefs, structures, and compiler characteristics.
XIPH_C__FUNC__
...
...
src/logging.c
View file @
4927a110
...
...
@@ -54,7 +54,15 @@ int get_clf_time (char *buffer, unsigned len, struct tm *t)
struct
tm
*
thetime
;
time_t
now
;
gmtime_r
(
&
time1
,
&
gmt
);
#if !defined(_WIN32)
thetime
=
gmtime_r
(
&
time1
,
&
gmt
)
#else
/* gmtime() on W32 breaks POSIX and IS thread-safe (uses TLS) */
thetime
=
gmtime
(
&
time1
);
if
(
thetime
)
memcpy
(
&
gmt
,
thetime
,
sizeof
(
gmt
));
#endif
/* FIXME: bail out if gmtime* returns NULL */
time_days
=
t
->
tm_yday
-
gmt
.
tm_yday
;
...
...
src/main.c
View file @
4927a110
...
...
@@ -41,9 +41,13 @@
#include "net/resolver.h"
#include "httpp/httpp.h"
#if
def CHUID
#if
HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_GRP_H
#include <grp.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
...
...
@@ -362,7 +366,7 @@ static void _ch_root_uid_setup(void)
}
#endif
#if
def
CHROOT
#if
HAVE_
CHROOT
if
(
conf
->
chroot
)
{
if
(
getuid
())
/* root check */
...
...
@@ -380,7 +384,7 @@ static void _ch_root_uid_setup(void)
}
#endif
#if
def
CHUID
#if
HAVE_
CHUID
if
(
conf
->
chuid
)
{
...
...
src/util.c
View file @
4927a110
...
...
@@ -494,7 +494,8 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
ice_config_t
*
config
;
time_t
now
;
struct
tm
result
;
char
currenttime_buffer
[
50
];
struct
tm
*
gmtime_result
;
char
currenttime_buffer
[
80
];
char
status_buffer
[
80
];
char
contenttype_buffer
[
80
];
ssize_t
ret
;
...
...
@@ -546,10 +547,22 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset,
}
time
(
&
now
);
strftime
(
currenttime_buffer
,
50
,
"%a, %d-%b-%Y %X GMT"
,
gmtime_r
(
&
now
,
&
result
));
#ifndef _WIN32
gmtime_result
=
gmtime_r
(
&
now
,
&
result
);
#else
/* gmtime() on W32 breaks POSIX and IS thread-safe (uses TLS) */
gmtime_result
=
gmtime
(
&
now
);
if
(
gmtime_result
)
memcpy
(
&
result
,
gmtime_result
,
sizeof
(
result
));
#endif
if
(
gmtime_result
)
strftime
(
currenttime_buffer
,
sizeof
(
currenttime_buffer
),
"Date: %a, %d-%b-%Y %X GMT
\r\n
"
,
gmtime_result
);
else
currenttime_buffer
[
0
]
=
'\0'
;
config
=
config_get_config
();
ret
=
snprintf
(
out
,
len
,
"%sServer: %s
\r\n
Date: %s
\r\n
%s%s%s%s%s"
,
ret
=
snprintf
(
out
,
len
,
"%sServer: %s
\r\n
%s
%s%s%s%s%s"
,
status_buffer
,
config
->
server_id
,
currenttime_buffer
,
...
...
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