nfs4: Several minor fixes
This commit is contained in:
@@ -593,7 +593,7 @@ ConnectionListener::Listen(ConnectionListener** _listener, uint16 port)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ConnectionListener::AcceptConnection(Connection** _connection)
|
ConnectionListener::AcceptConnection(Connection** connection)
|
||||||
{
|
{
|
||||||
object_wait_info object[2];
|
object_wait_info object[2];
|
||||||
object[0].object = fWaitCancel;
|
object[0].object = fWaitCancel;
|
||||||
@@ -623,15 +623,13 @@ ConnectionListener::AcceptConnection(Connection** _connection)
|
|||||||
ServerAddress address;
|
ServerAddress address;
|
||||||
address.fProtocol = IPPROTO_TCP;
|
address.fProtocol = IPPROTO_TCP;
|
||||||
address.fAddress = addr;
|
address.fAddress = addr;
|
||||||
Connection* connection;
|
|
||||||
|
|
||||||
status_t result = Connection::SetTo(&connection, sock, address);
|
status_t result = Connection::SetTo(connection, sock, address);
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
close(sock);
|
close(sock);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
*_connection = connection;
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ enum {
|
|||||||
PROGRAM_NFS_CB = 0x40000000
|
PROGRAM_NFS_CB = 0x40000000
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NFS_VERSION 4
|
#define NFS_CB_VERSION 1
|
||||||
|
|
||||||
|
|
||||||
CallbackRequest::CallbackRequest(void *buffer, int size)
|
CallbackRequest::CallbackRequest(void *buffer, int size)
|
||||||
@@ -46,6 +46,9 @@ CallbackRequest::CallbackRequest(void *buffer, int size)
|
|||||||
if (fStream.GetUInt() != PROGRAM_NFS_CB)
|
if (fStream.GetUInt() != PROGRAM_NFS_CB)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (fStream.GetUInt() != NFS_CB_VERSION)
|
||||||
|
return;
|
||||||
|
|
||||||
fProcedure = fStream.GetUInt();
|
fProcedure = fStream.GetUInt();
|
||||||
|
|
||||||
fStream.GetOpaque(NULL);
|
fStream.GetOpaque(NULL);
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ CallbackServer::NewConnection(Connection* connection)
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
arguments[0] = this;
|
arguments[0] = this;
|
||||||
arguments[1] = connection;
|
arguments[1] = entry;
|
||||||
|
|
||||||
thread_id thread;
|
thread_id thread;
|
||||||
thread = spawn_kernel_thread(&CallbackServer::ConnectionThreadLauncher,
|
thread = spawn_kernel_thread(&CallbackServer::ConnectionThreadLauncher,
|
||||||
@@ -224,7 +224,7 @@ status_t
|
|||||||
CallbackServer::ConnectionThread(ConnectionEntry* entry)
|
CallbackServer::ConnectionThread(ConnectionEntry* entry)
|
||||||
{
|
{
|
||||||
Connection* connection = entry->fConnection;
|
Connection* connection = entry->fConnection;
|
||||||
dprintf("NEW CONNECTION\n");
|
|
||||||
while (fThreadRunning) {
|
while (fThreadRunning) {
|
||||||
uint32 size;
|
uint32 size;
|
||||||
void* buffer;
|
void* buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user