with Ingo's help:
* fixed the build of netfs under BONE/Dano by using the already existing build system defines instead of wrong checks for wether to use BONE headers * the client tried to bind to a non existing address for receiving broadcasts from the server (but the broadcasts are still not received, which will be worked on next) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21409 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
//# define B_BAD_DATA -2147483632L
|
//# define B_BAD_DATA -2147483632L
|
||||||
#else
|
#else
|
||||||
# ifndef closesocket
|
# ifndef closesocket
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
@@ -293,7 +293,7 @@ ServerManager::_BroadcastListener()
|
|||||||
sockaddr_in addr;
|
sockaddr_in addr;
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(kDefaultBroadcastPort);
|
addr.sin_port = htons(kDefaultBroadcastPort);
|
||||||
addr.sin_addr.s_addr = INADDR_BROADCAST;
|
addr.sin_addr.s_addr = INADDR_ANY;
|
||||||
int addrSize = sizeof(addr);
|
int addrSize = sizeof(addr);
|
||||||
BroadcastMessage message;
|
BroadcastMessage message;
|
||||||
//PRINT(("ServerManager::_BroadcastListener(): recvfrom()...\n"));
|
//PRINT(("ServerManager::_BroadcastListener(): recvfrom()...\n"));
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
#ifndef NET_FS_INSECURE_CONNECTION_H
|
#ifndef NET_FS_INSECURE_CONNECTION_H
|
||||||
#define NET_FS_INSECURE_CONNECTION_H
|
#define NET_FS_INSECURE_CONNECTION_H
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
#ifndef NET_FS_NET_ADDRESS_H
|
#ifndef NET_FS_NET_ADDRESS_H
|
||||||
#define NET_FS_NET_ADDRESS_H
|
#define NET_FS_NET_ADDRESS_H
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
|
|||||||
+7
-2
@@ -3,9 +3,10 @@
|
|||||||
#ifndef UTILS_H
|
#ifndef UTILS_H
|
||||||
#define UTILS_H
|
#define UTILS_H
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
|
# include <sys/socket.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -26,8 +27,12 @@ void
|
|||||||
safe_closesocket(vint32& socketVar)
|
safe_closesocket(vint32& socketVar)
|
||||||
{
|
{
|
||||||
int32 socket = atomic_or(&socketVar, -1);
|
int32 socket = atomic_or(&socketVar, -1);
|
||||||
if (socket >= 0)
|
if (socket >= 0) {
|
||||||
|
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
|
shutdown(socket, SHUTDOWN_BOTH);
|
||||||
|
#endif
|
||||||
closesocket(socket);
|
closesocket(socket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILS_H
|
#endif // UTILS_H
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
#ifndef NET_FS_INSECURE_CONNECTION_LISTENER_H
|
#ifndef NET_FS_INSECURE_CONNECTION_LISTENER_H
|
||||||
#define NET_FS_INSECURE_CONNECTION_LISTENER_H
|
#define NET_FS_INSECURE_CONNECTION_LISTENER_H
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@@ -1172,7 +1172,7 @@ NetFSServer::_Broadcaster()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the socket broadcast option
|
// set the socket broadcast option
|
||||||
#if B_BEOS_VERSION > B_BEOS_VERSION_5
|
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
int soBroadcastValue = 1;
|
int soBroadcastValue = 1;
|
||||||
if (setsockopt(fBroadcastingSocket, SOL_SOCKET, SO_BROADCAST,
|
if (setsockopt(fBroadcastingSocket, SOL_SOCKET, SO_BROADCAST,
|
||||||
&soBroadcastValue, sizeof(soBroadcastValue)) < 0) {
|
&soBroadcastValue, sizeof(soBroadcastValue)) < 0) {
|
||||||
|
|||||||
+6
-6
@@ -423,10 +423,10 @@ SecurityContext::SecurityContext(BMessage* archive)
|
|||||||
BMessage permissionsArchive;
|
BMessage permissionsArchive;
|
||||||
if (archive->FindMessage("permissions", &permissionsArchive) != B_OK)
|
if (archive->FindMessage("permissions", &permissionsArchive) != B_OK)
|
||||||
return;
|
return;
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_DANO
|
||||||
char* userName;
|
|
||||||
#else
|
|
||||||
const char* userName;
|
const char* userName;
|
||||||
|
#else
|
||||||
|
char* userName;
|
||||||
#endif
|
#endif
|
||||||
type_code type;
|
type_code type;
|
||||||
for (int32 userIndex = 0;
|
for (int32 userIndex = 0;
|
||||||
@@ -442,10 +442,10 @@ SecurityContext::SecurityContext(BMessage* archive)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// got a user: iterate through its permissions
|
// got a user: iterate through its permissions
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_DANO
|
||||||
char* path;
|
|
||||||
#else
|
|
||||||
const char* path;
|
const char* path;
|
||||||
|
#else
|
||||||
|
char* path;
|
||||||
#endif
|
#endif
|
||||||
for (int32 i = 0;
|
for (int32 i = 0;
|
||||||
userArchive.GetInfo(B_INT32_TYPE, i, &path, &type) == B_OK;
|
userArchive.GetInfo(B_INT32_TYPE, i, &path, &type) == B_OK;
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <socket.h>
|
# include <socket.h>
|
||||||
#else
|
#else
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@@ -30,7 +30,7 @@ InsecureChannel::InsecureChannel(int socket)
|
|||||||
int dontBlock = 0;
|
int dontBlock = 0;
|
||||||
setsockopt(fSocket, SOL_SOCKET, SO_NONBLOCK, &dontBlock, sizeof(int));
|
setsockopt(fSocket, SOL_SOCKET, SO_NONBLOCK, &dontBlock, sizeof(int));
|
||||||
|
|
||||||
#if B_BEOS_VERSION > B_BEOS_VERSION_5
|
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
int txLowWater = 1;
|
int txLowWater = 1;
|
||||||
setsockopt(fSocket, SOL_SOCKET, SO_SNDLOWAT, &txLowWater, sizeof(int));
|
setsockopt(fSocket, SOL_SOCKET, SO_SNDLOWAT, &txLowWater, sizeof(int));
|
||||||
setsockopt(fSocket, SOL_SOCKET, SO_RCVLOWAT, &txLowWater, sizeof(int));
|
setsockopt(fSocket, SOL_SOCKET, SO_RCVLOWAT, &txLowWater, sizeof(int));
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
static const uint32 kMessageHeaderMagic = 'kMsG';
|
static const uint32 kMessageHeaderMagic = 'kMsG';
|
||||||
static const int32 kMessageReallocChunkSize = 64;
|
static const int32 kMessageReallocChunkSize = 64;
|
||||||
|
|
||||||
#if B_BEOS_VERSION <= B_BEOS_VERSION_5
|
|
||||||
//# define B_BAD_DATA -2147483632L
|
|
||||||
#endif
|
|
||||||
#ifndef B_BUFFER_OVERFLOW
|
#ifndef B_BUFFER_OVERFLOW
|
||||||
# define B_BUFFER_OVERFLOW EOVERFLOW
|
# define B_BUFFER_OVERFLOW EOVERFLOW
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user