[xiph-cvs] cvs commit: net sock.c sock.h
Brendan
brendan at xiph.org
Thu Jun 5 10:09:12 PDT 2003
brendan 03/06/05 13:09:12
Modified: . configure.in
. httpp.c
. sock.c sock.h
Log:
Karl's patch for freebsd, minus the sys/select.h test which breaks on OS X.
Also enables IPV6 in libshout!
Revision Changes Path
1.42 +6 -4 libshout/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/libshout/configure.in,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -u -r1.41 -r1.42
--- configure.in 5 Jun 2003 14:32:35 -0000 1.41
+++ configure.in 5 Jun 2003 17:09:12 -0000 1.42
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-# $Id: configure.in,v 1.41 2003/06/05 14:32:35 brendan Exp $
+# $Id: configure.in,v 1.42 2003/06/05 17:09:12 brendan Exp $
m4_define(libshout_major, 2)
m4_define(libshout_minor, 0)
@@ -36,7 +36,7 @@ dnl to be fine
case "$ac_cv_host" in
*openbsd*)
;;
- *) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
+ *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
;;
esac
if test -z "$GCC"; then
@@ -68,7 +68,7 @@ dnl Checks for programs.
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([inttypes.h sys/socket.h sys/uio.h])
+AC_CHECK_HEADERS([inttypes.h strings.h sys/socket.h sys/uio.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -113,7 +113,9 @@ typedef int socklen_t;
dnl Checks for library functions.
AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(sethostent endhostent)
-AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_pton inet_aton)
+AC_SEARCH_LIBS([inet_pton], [socket],
+ [AC_DEFINE([HAVE_INET_PTON], [1], [Define if you have the inet_pton function])])
+AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_aton)
dnl Extra dependencies
<p><p>1.19 +3 -0 httpp/httpp.c
Index: httpp.c
===================================================================
RCS file: /usr/local/cvsroot/httpp/httpp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -u -r1.18 -r1.19
--- httpp.c 15 Mar 2003 02:10:18 -0000 1.18
+++ httpp.c 5 Jun 2003 17:09:12 -0000 1.19
@@ -12,6 +12,9 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <avl/avl.h>
#include "httpp.h"
<p><p>1.24 +5 -5 net/sock.c
Index: sock.c
===================================================================
RCS file: /usr/local/cvsroot/net/sock.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -u -r1.23 -r1.24
--- sock.c 3 Jun 2003 18:29:23 -0000 1.23
+++ sock.c 5 Jun 2003 17:09:12 -0000 1.24
@@ -92,7 +92,7 @@ char *sock_get_localip(char *buff, int l
{
char temp[1024];
- if (gethostname(temp, 1024) != 0)
+ if (gethostname(temp, sizeof(temp)) != 0)
return NULL;
if (resolver_getip(temp, buff, len))
@@ -588,7 +588,7 @@ sock_t sock_connect_wto(const char *host
*/
sock_t sock_get_server_socket(const int port, char *sinterface)
{
-#ifdef HAVE_IPV6
+#ifdef HAVE_INET_PTON
struct sockaddr_storage sa;
#else
struct sockaddr_in sa;
@@ -610,7 +610,7 @@ sock_t sock_get_server_socket(const int
if (!resolver_getip(sinterface, ip, sizeof (ip)))
return SOCK_ERROR;
-#ifdef HAVE_IPV6
+#ifdef HAVE_INET_PTON
if (inet_pton(AF_INET, ip, &((struct sockaddr_in*)&sa)->sin_addr) > 0) {
((struct sockaddr_in*)&sa)->sin_family = AF_INET;
((struct sockaddr_in*)&sa)->sin_port = htons(port);
@@ -667,7 +667,7 @@ int sock_listen(sock_t serversock, int b
int sock_accept(sock_t serversock, char *ip, int len)
{
-#ifdef HAVE_IPV6
+#ifdef HAVE_INET_PTON
struct sockaddr_storage sa;
#else
struct sockaddr_in sa;
@@ -682,7 +682,7 @@ int sock_accept(sock_t serversock, char
ret = accept(serversock, (struct sockaddr *)&sa, &slen);
if (ret >= 0 && ip != NULL) {
-#ifdef HAVE_IPV6
+#ifdef HAVE_INET_PTON
if(((struct sockaddr_in *)&sa)->sin_family == AF_INET)
inet_ntop(AF_INET, &((struct sockaddr_in *)&sa)->sin_addr,
ip, len);
<p><p>1.14 +0 -5 net/sock.h
Index: sock.h
===================================================================
RCS file: /usr/local/cvsroot/net/sock.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -u -r1.13 -r1.14
--- sock.h 17 Mar 2003 16:47:20 -0000 1.13
+++ sock.h 5 Jun 2003 17:09:12 -0000 1.14
@@ -107,8 +107,3 @@ int inet_aton(const char *s, struct in_a
#endif
#endif /* __SOCK_H */
-
-
-
-
-
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list