wrowe 01/12/07 15:29:07
Modified: network_io/os2 sockets.c
network_io/win32 sockets.c
Log:
Fix a bug in OS2 related to AF_UNSPEC, and drop a NETWARE section that
duplicates the correct code. If we need to do something with proto,
then _that_ can be hidden in an ifdef WIN32
Revision Changes Path
1.48 +4 -4 apr/network_io/os2/sockets.c
Index: sockets.c
===================================================================
RCS file: /home/cvs/apr/network_io/os2/sockets.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- sockets.c 2001/08/10 21:04:48 1.47
+++ sockets.c 2001/12/07 23:29:06 1.48
@@ -130,10 +130,10 @@
(*new)->remote_addr->pool = p;
}
-APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily,
int type,
+APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family,
int type,
apr_pool_t *cont)
{
- int family = ofamily;
+ int downgrade = (family == AF_UNSPEC);
if (family == AF_UNSPEC) {
#if APR_HAVE_IPV6
@@ -152,9 +152,9 @@
return APR_ENOMEM;
}
- (*new)->socketdes = socket(AF_INET, type, 0);
+ (*new)->socketdes = socket(family, type, 0);
#if APR_HAVE_IPV6
- if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) {
+ if ((*new)->socketdes < 0 && downgrade) {
family = AF_INET;
(*new)->socketdes = socket(family, type, 0);
}
1.68 +3 -8 apr/network_io/win32/sockets.c
Index: sockets.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sockets.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- sockets.c 2001/12/07 23:14:18 1.67
+++ sockets.c 2001/12/07 23:29:07 1.68
@@ -117,10 +117,9 @@
(*new)->remote_addr->pool = p;
}
-APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily,
+APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family,
int type, apr_pool_t *cont)
{
- int family = ofamily;
int downgrade = (family == AF_UNSPEC);
if (family == AF_UNSPEC) {
@@ -140,18 +139,14 @@
return APR_ENOMEM;
}
-#ifdef NETWARE
- (*new)->sock = socket(family, type, 0);
-#else
/* For right now, we are not using socket groups. We may later.
* No flags to use when creating a socket, so use 0 for that parameter
as well.
*/
- (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0);
-#endif
+ (*new)->sock = socket(family, type, 0);
#if APR_HAVE_IPV6
if ((*new)->sock == INVALID_SOCKET && downgrade) {
family = AF_INET;
- (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0);
+ (*new)->sock = socket(family, type, 0);
}
#endif