summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/JackClient.cpp4
-rw-r--r--common/JackClientControl.h2
-rw-r--r--common/JackConstants.h3
-rw-r--r--common/JackEngine.cpp10
-rw-r--r--common/JackRequest.h10
-rw-r--r--posix/JackSocketClientChannel.cpp2
6 files changed, 17 insertions, 14 deletions
diff --git a/common/JackClient.cpp b/common/JackClient.cpp
index 999b97b7..89141499 100644
--- a/common/JackClient.cpp
+++ b/common/JackClient.cpp
@@ -277,7 +277,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
jack_log("JackClient::kSessionCallback");
if (fSession) {
jack_session_event_t *event = (jack_session_event_t *) malloc( sizeof(jack_session_event_t) );
- char uuid_buf[32];
+ char uuid_buf[JACK_UUID_SIZE];
event->type = (jack_session_event_type_t) value1;
event->session_dir = strdup( message );
event->command_line = NULL;
@@ -1111,7 +1111,7 @@ int JackClient::SessionReply( jack_session_event_t *ev )
char* JackClient::GetUUIDForClientName(const char* client_name)
{
- char uuid_res[JACK_CLIENT_NAME_SIZE + 1];
+ char uuid_res[JACK_UUID_SIZE];
int result = -1;
fChannel->GetUUIDForClientName( GetClientControl()->fRefNum, client_name, uuid_res, &result);
diff --git a/common/JackClientControl.h b/common/JackClientControl.h
index 7a88c1e2..98f2ad31 100644
--- a/common/JackClientControl.h
+++ b/common/JackClientControl.h
@@ -47,7 +47,7 @@ struct JackClientControl : public JackShmMemAble
bool fActive;
int fSessionID;
- char fSessionCommand[256 + 1];
+ char fSessionCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fSessionFlags;
JackClientControl(const char* name, int pid, int refnum, int uuid)
diff --git a/common/JackConstants.h b/common/JackConstants.h
index 94a7e422..ac165837 100644
--- a/common/JackConstants.h
+++ b/common/JackConstants.h
@@ -33,6 +33,8 @@
#define JACK_CLIENT_NAME_SIZE 64
#define JACK_MESSAGE_SIZE 256
+#define JACK_UUID_SIZE 32
+#define JACK_SESSION_COMMAND_SIZE 256
#ifndef PORT_NUM
#define PORT_NUM 2048
@@ -71,6 +73,7 @@
#define FREEWHEEL_DRIVER_TIMEOUT 10 // in sec
#define DRIVER_TIMEOUT_FACTOR 10
+
#define NO_PORT 0xFFFE
#define EMPTY 0xFFFD
diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp
index d312394c..6f085f9c 100644
--- a/common/JackEngine.cpp
+++ b/common/JackEngine.cpp
@@ -955,7 +955,7 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
if (result == 2) {
fSessionPendingReplies += 1;
} else if (result == 1) {
- char uuid_buf[32];
+ char uuid_buf[JACK_UUID_SIZE];
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID );
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf,
client->GetClientControl()->fName,
@@ -977,7 +977,7 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
void JackEngine::SessionReply(int refnum)
{
JackClientInterface* client = fClientTable[refnum];
- char uuid_buf[32];
+ char uuid_buf[JACK_UUID_SIZE];
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID );
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf,
client->GetClientControl()->fName,
@@ -998,7 +998,7 @@ void JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res, i
JackClientInterface* client = fClientTable[i];
if (client && (strcmp(client_name, client->GetClientControl()->fName)==0)) {
- snprintf(uuid_res, 32, "%d", client->GetClientControl()->fSessionID);
+ snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
*result = 0;
return;
}
@@ -1016,8 +1016,8 @@ void JackEngine::GetClientNameForUUID(const char *uuid, char *name_res, int *res
if (!client)
continue;
- char uuid_buf[33];
- snprintf(uuid_buf, 32, "%d", client->GetClientControl()->fSessionID);
+ char uuid_buf[JACK_UUID_SIZE];
+ snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
if (strcmp(uuid,uuid_buf) == 0) {
strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
diff --git a/common/JackRequest.h b/common/JackRequest.h
index c1c2b3ce..6ce6d2ea 100644
--- a/common/JackRequest.h
+++ b/common/JackRequest.h
@@ -1084,9 +1084,9 @@ struct JackClientNotificationRequest : public JackRequest
struct JackSessionCommand
{
- char fUUID[32];
+ char fUUID[JACK_UUID_SIZE];
char fClientName[JACK_CLIENT_NAME_SIZE+1];
- char fCommand[MAX_PATH+1];
+ char fCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fFlags;
JackSessionCommand()
@@ -1252,7 +1252,7 @@ struct JackClientNameResult : public JackResult
struct JackUUIDResult : public JackResult
{
- char fUUID[32 + 1];
+ char fUUID[JACK_UUID_SIZE];
JackUUIDResult(): JackResult()
{}
@@ -1309,7 +1309,7 @@ struct JackGetUUIDRequest : public JackRequest
struct JackGetClientNameRequest : public JackRequest
{
- char fUUID[32 + 1];
+ char fUUID[JACK_UUID_SIZE];
JackGetClientNameRequest()
{}
@@ -1340,7 +1340,7 @@ struct JackReserveNameRequest : public JackRequest
{
int fRefNum;
char fName[JACK_CLIENT_NAME_SIZE + 1];
- char fUUID[32 + 1];
+ char fUUID[JACK_UUID_SIZE];
JackReserveNameRequest()
{}
diff --git a/posix/JackSocketClientChannel.cpp b/posix/JackSocketClientChannel.cpp
index 46d53f78..0090fe2b 100644
--- a/posix/JackSocketClientChannel.cpp
+++ b/posix/JackSocketClientChannel.cpp
@@ -286,7 +286,7 @@ void JackSocketClientChannel::GetUUIDForClientName( int refnum, const char *clie
JackGetUUIDRequest req(client_name);
JackUUIDResult res;
ServerSyncCall(&req, &res, result);
- strncpy( uuid_res, res.fUUID, 32 );
+ strncpy( uuid_res, res.fUUID, JACK_UUID_SIZE );
}
void JackSocketClientChannel::GetClientNameForUUID( int refnum, const char *uuid, char *name_res, int *result )