*error_r = "CONNECT: Not enough parameters";
return -1;
}
+ if (guid_128_from_string(args[0], conn_guid) < 0) {
+ *error_r = "CONNECT: Invalid conn-guid";
+ return -1;
+ }
+ args++;
if (str_to_pid(args[0], &pid) < 0) {
*error_r = "CONNECT: Invalid pid";
return -1;
*error_r = "CONNECT: Invalid ident string";
return -1;
}
- if (args[0] == NULL) {
- *error_r = "CONNECT: Missing conn-guid";
- return -1;
- }
- if (guid_128_from_string(args[0], conn_guid) < 0) {
- *error_r = "CONNECT: Invalid conn-guid";
- return -1;
- }
connect_limit_connect(connect_limit, pid, &key, conn_guid);
} else if (strcmp(cmd, "DISCONNECT") == 0) {
if (args[0] == NULL || args[1] == NULL) {
*error_r = "DISCONNECT: Not enough parameters";
return -1;
}
+ if (guid_128_from_string(args[0], conn_guid) < 0) {
+ *error_r = "DISCONNECT: Invalid conn-guid";
+ return -1;
+ }
+ args++;
if (str_to_pid(args[0], &pid) < 0) {
*error_r = "DISCONNECT: Invalid pid";
return -1;
*error_r = "DISCONNECT: Invalid ident string";
return -1;
}
- if (args[0] == NULL) {
- *error_r = "DISCONNECT: Missing conn-guid";
- return -1;
- }
- if (guid_128_from_string(args[0], conn_guid) < 0) {
- *error_r = "DISCONNECT: Invalid conn-guid";
- return -1;
- }
connect_limit_disconnect(connect_limit, pid, &key, conn_guid);
} else if (strcmp(cmd, "CONNECT-DUMP") == 0) {
connect_limit_dump(connect_limit, conn->output);
string_t *cmd = t_str_new(128);
str_append(cmd, "CONNECT\t");
- master_service_anvil_session_to_cmd(cmd, session);
- str_append_c(cmd, '\t');
str_append(cmd, guid_128_to_string(conn_guid_r));
+ str_append_c(cmd, '\t');
+ master_service_anvil_session_to_cmd(cmd, session);
str_append_c(cmd, '\n');
return master_service_anvil_send(service, str_c(cmd));
}
{
string_t *cmd = t_str_new(128);
str_append(cmd, "DISCONNECT\t");
- master_service_anvil_session_to_cmd(cmd, session);
- str_append_c(cmd, '\t');
str_append(cmd, guid_128_to_string(conn_guid));
+ str_append_c(cmd, '\t');
+ master_service_anvil_session_to_cmd(cmd, session);
str_append_c(cmd, '\n');
(void)master_service_anvil_send(service, str_c(cmd));
}