Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jack2
Commits
5cd7b4de
Commit
5cd7b4de
authored
Aug 27, 2010
by
Torben Hohn
Browse files
add uuid parameter to ClientCheck method.
Conflicts: common/JackEngine.cpp
parent
48463edc
Changes
11
Hide whitespace changes
Inline
Side-by-side
common/JackChannel.h
View file @
5cd7b4de
...
...
@@ -50,7 +50,7 @@ class JackClientChannelInterface
{}
// Open the Server/Client connection
virtual
int
Open
(
const
char
*
server_name
,
const
char
*
name
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
)
virtual
int
Open
(
const
char
*
server_name
,
const
char
*
name
,
int
uuid
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
)
{
return
0
;
}
...
...
@@ -74,7 +74,7 @@ class JackClientChannelInterface
return
-
1
;
}
virtual
void
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
)
virtual
void
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
)
{}
virtual
void
ClientOpen
(
const
char
*
name
,
int
pid
,
int
uuid
,
int
*
shared_engine
,
int
*
shared_client
,
int
*
shared_graph
,
int
*
result
)
{}
...
...
common/JackEngine.cpp
View file @
5cd7b4de
...
...
@@ -389,7 +389,7 @@ int JackEngine::InternalClientUnload(int refnum, int* status)
// Client management
//-------------------
int
JackEngine
::
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
)
int
JackEngine
::
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
)
{
// Clear status
*
status
=
0
;
...
...
@@ -403,7 +403,11 @@ int JackEngine::ClientCheck(const char* name, char* name_res, int protocol, int
return
-
1
;
}
if
(
ClientCheckName
(
name
))
{
std
::
map
<
int
,
std
::
string
>::
iterator
res
=
fReservationMap
.
find
(
uuid
);
if
(
res
!=
fReservationMap
.
end
())
{
strncpy
(
name_res
,
res
->
second
.
c_str
(),
JACK_CLIENT_NAME_SIZE
);
}
else
if
(
ClientCheckName
(
name
))
{
*
status
|=
JackNameNotUnique
;
...
...
@@ -531,7 +535,7 @@ int JackEngine::ClientExternalOpen(const char* name, int pid, int uuid, int* ref
EnsureUUID
(
uuid
);
}
jack_log
(
"JackEngine::ClientExternalOpen: name = %s "
,
real_name
);
jack_log
(
"JackEngine::ClientExternalOpen:
uuid=%d,
name = %s "
,
uuid
,
real_name
);
int
refnum
=
AllocateRefnum
();
if
(
refnum
<
0
)
{
...
...
@@ -1023,13 +1027,17 @@ void JackEngine::GetClientNameForUUID(const char *uuid, char *name_res, int *res
void
JackEngine
::
ReserveClientName
(
const
char
*
name
,
const
char
*
uuid
,
int
*
result
)
{
jack_log
(
"JackEngine::ReserveClientName ( name = %s, uuid = %s )"
,
name
,
uuid
);
if
(
ClientCheckName
(
name
))
{
*
result
=
-
1
;
jack_log
(
"name already taken"
);
return
;
}
EnsureUUID
(
atoi
(
uuid
));
fReservationMap
[
atoi
(
uuid
)]
=
name
;
*
result
=
0
;
}
}
// end of namespace
...
...
common/JackEngine.h
View file @
5cd7b4de
...
...
@@ -98,7 +98,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble
int
Close
();
// Client management
int
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
);
int
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
);
int
ClientExternalOpen
(
const
char
*
name
,
int
pid
,
int
uuid
,
int
*
ref
,
int
*
shared_engine
,
int
*
shared_client
,
int
*
shared_graph_manager
);
int
ClientInternalOpen
(
const
char
*
name
,
int
*
ref
,
JackEngineControl
**
shared_engine
,
JackGraphManager
**
shared_manager
,
JackClientInterface
*
client
,
bool
wait
);
...
...
common/JackInternalClient.cpp
View file @
5cd7b4de
...
...
@@ -71,7 +71,7 @@ int JackInternalClient::Open(const char* server_name, const char* name, int uuid
strncpy
(
fServerName
,
server_name
,
sizeof
(
fServerName
));
fChannel
->
ClientCheck
(
name
,
name_res
,
JACK_PROTOCOL_VERSION
,
(
int
)
options
,
(
int
*
)
status
,
&
result
);
fChannel
->
ClientCheck
(
name
,
uuid
,
name_res
,
JACK_PROTOCOL_VERSION
,
(
int
)
options
,
(
int
*
)
status
,
&
result
);
if
(
result
<
0
)
{
int
status1
=
*
status
;
if
(
status1
&
JackVersionError
)
...
...
common/JackInternalClientChannel.h
View file @
5cd7b4de
...
...
@@ -52,7 +52,7 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
void
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
)
{
*
result
=
fEngine
->
ClientCheck
(
name
,
name_res
,
protocol
,
options
,
status
);
*
result
=
fEngine
->
ClientCheck
(
name
,
-
1
,
name_res
,
protocol
,
options
,
status
);
}
void
ClientOpen
(
const
char
*
name
,
int
*
ref
,
JackEngineControl
**
shared_engine
,
JackGraphManager
**
shared_manager
,
JackClientInterface
*
client
,
int
*
result
)
{
...
...
common/JackLibClient.cpp
View file @
5cd7b4de
...
...
@@ -76,7 +76,7 @@ int JackLibClient::Open(const char* server_name, const char* name, int uuid, jac
// Open server/client channel
char
name_res
[
JACK_CLIENT_NAME_SIZE
+
1
];
if
(
fChannel
->
Open
(
server_name
,
name
,
name_res
,
this
,
options
,
status
)
<
0
)
{
if
(
fChannel
->
Open
(
server_name
,
name
,
uuid
,
name_res
,
this
,
options
,
status
)
<
0
)
{
jack_error
(
"Cannot connect to the server"
);
goto
error
;
}
...
...
common/JackLockedEngine.h
View file @
5cd7b4de
...
...
@@ -96,11 +96,11 @@ class SERVER_EXPORT JackLockedEngine
}
// Client management
int
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
)
int
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
)
{
TRY_CALL
JackLock
lock
(
&
fEngine
);
return
fEngine
.
ClientCheck
(
name
,
name_res
,
protocol
,
options
,
status
);
return
fEngine
.
ClientCheck
(
name
,
uuid
,
name_res
,
protocol
,
options
,
status
);
CATCH_EXCEPTION_RETURN
}
int
ClientExternalOpen
(
const
char
*
name
,
int
pid
,
int
uuid
,
int
*
ref
,
int
*
shared_engine
,
int
*
shared_client
,
int
*
shared_graph_manager
)
...
...
common/JackRequest.h
View file @
5cd7b4de
...
...
@@ -135,11 +135,12 @@ struct JackClientCheckRequest : public JackRequest
char
fName
[
JACK_CLIENT_NAME_SIZE
+
1
];
int
fProtocol
;
int
fOptions
;
int
fUUID
;
JackClientCheckRequest
()
{}
JackClientCheckRequest
(
const
char
*
name
,
int
protocol
,
int
options
)
:
JackRequest
(
JackRequest
::
kClientCheck
),
fProtocol
(
protocol
),
fOptions
(
options
)
JackClientCheckRequest
(
const
char
*
name
,
int
protocol
,
int
options
,
int
uuid
)
:
JackRequest
(
JackRequest
::
kClientCheck
),
fProtocol
(
protocol
),
fOptions
(
options
)
,
fUUID
(
uuid
)
{
snprintf
(
fName
,
sizeof
(
fName
),
"%s"
,
name
);
}
...
...
@@ -148,7 +149,8 @@ struct JackClientCheckRequest : public JackRequest
{
CheckRes
(
trans
->
Read
(
&
fName
,
sizeof
(
fName
)));
CheckRes
(
trans
->
Read
(
&
fProtocol
,
sizeof
(
int
)));
return
trans
->
Read
(
&
fOptions
,
sizeof
(
int
));
CheckRes
(
trans
->
Read
(
&
fOptions
,
sizeof
(
int
)));
return
trans
->
Read
(
&
fUUID
,
sizeof
(
int
));
}
int
Write
(
JackChannelTransaction
*
trans
)
...
...
@@ -156,7 +158,8 @@ struct JackClientCheckRequest : public JackRequest
CheckRes
(
JackRequest
::
Write
(
trans
));
CheckRes
(
trans
->
Write
(
&
fName
,
sizeof
(
fName
)));
CheckRes
(
trans
->
Write
(
&
fProtocol
,
sizeof
(
int
)));
return
trans
->
Write
(
&
fOptions
,
sizeof
(
int
));
CheckRes
(
trans
->
Write
(
&
fOptions
,
sizeof
(
int
)));
return
trans
->
Write
(
&
fUUID
,
sizeof
(
int
));
}
};
...
...
posix/JackSocketClientChannel.cpp
View file @
5cd7b4de
...
...
@@ -51,7 +51,7 @@ int JackSocketClientChannel::ServerCheck(const char* server_name)
}
}
int
JackSocketClientChannel
::
Open
(
const
char
*
server_name
,
const
char
*
name
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
)
int
JackSocketClientChannel
::
Open
(
const
char
*
server_name
,
const
char
*
name
,
int
uuid
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
)
{
int
result
=
0
;
jack_log
(
"JackSocketClientChannel::Open name = %s"
,
name
);
...
...
@@ -62,7 +62,7 @@ int JackSocketClientChannel::Open(const char* server_name, const char* name, cha
}
// Check name in server
ClientCheck
(
name
,
name_res
,
JACK_PROTOCOL_VERSION
,
(
int
)
options
,
(
int
*
)
status
,
&
result
);
ClientCheck
(
name
,
uuid
,
name_res
,
JACK_PROTOCOL_VERSION
,
(
int
)
options
,
(
int
*
)
status
,
&
result
);
if
(
result
<
0
)
{
int
status1
=
*
status
;
if
(
status1
&
JackVersionError
)
...
...
@@ -142,9 +142,9 @@ void JackSocketClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res,
}
}
void
JackSocketClientChannel
::
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
)
void
JackSocketClientChannel
::
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
)
{
JackClientCheckRequest
req
(
name
,
protocol
,
options
);
JackClientCheckRequest
req
(
name
,
protocol
,
options
,
uuid
);
JackClientCheckResult
res
;
ServerSyncCall
(
&
req
,
&
res
,
result
);
*
status
=
res
.
fStatus
;
...
...
posix/JackSocketClientChannel.h
View file @
5cd7b4de
...
...
@@ -52,7 +52,7 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi
JackSocketClientChannel
();
virtual
~
JackSocketClientChannel
();
int
Open
(
const
char
*
server_name
,
const
char
*
name
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
);
int
Open
(
const
char
*
server_name
,
const
char
*
name
,
int
uuid
,
char
*
name_res
,
JackClient
*
obj
,
jack_options_t
options
,
jack_status_t
*
status
);
void
Close
();
int
Start
();
...
...
@@ -60,7 +60,7 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi
int
ServerCheck
(
const
char
*
server_name
);
void
ClientCheck
(
const
char
*
name
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
);
void
ClientCheck
(
const
char
*
name
,
int
uuid
,
char
*
name_res
,
int
protocol
,
int
options
,
int
*
status
,
int
*
result
);
void
ClientOpen
(
const
char
*
name
,
int
pid
,
int
uuid
,
int
*
shared_engine
,
int
*
shared_client
,
int
*
shared_graph
,
int
*
result
);
void
ClientOpen
(
const
char
*
name
,
int
*
ref
,
int
uuid
,
JackEngineControl
**
shared_engine
,
JackGraphManager
**
shared_manager
,
JackClientInterface
*
client
,
int
*
result
)
{}
...
...
posix/JackSocketServerChannel.cpp
View file @
5cd7b4de
...
...
@@ -176,7 +176,7 @@ bool JackSocketServerChannel::HandleRequest(int fd)
JackClientCheckRequest
req
;
JackClientCheckResult
res
;
if
(
req
.
Read
(
socket
)
==
0
)
res
.
fResult
=
fServer
->
GetEngine
()
->
ClientCheck
(
req
.
fName
,
res
.
fName
,
req
.
fProtocol
,
req
.
fOptions
,
&
res
.
fStatus
);
res
.
fResult
=
fServer
->
GetEngine
()
->
ClientCheck
(
req
.
fName
,
req
.
fUUID
,
res
.
fName
,
req
.
fProtocol
,
req
.
fOptions
,
&
res
.
fStatus
);
if
(
res
.
Write
(
socket
)
<
0
)
jack_error
(
"JackRequest::ClientCheck write error name = %s"
,
req
.
fName
);
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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