Fix issue 1129 for not sending stat to to undefined socket (#1132)
This fix avoids trying to do operations on a socket that was never opened successfully.
Этот коммит содержится в:
родитель
53a68308ba
Коммит
44c6fed2b6
@ -1628,10 +1628,12 @@ int iperf_open_logfile(struct iperf_test *test)
|
||||
int
|
||||
iperf_set_send_state(struct iperf_test *test, signed char state)
|
||||
{
|
||||
test->state = state;
|
||||
if (Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp) < 0) {
|
||||
i_errno = IESENDMESSAGE;
|
||||
return -1;
|
||||
if (test->ctrl_sck >= 0) {
|
||||
test->state = state;
|
||||
if (Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp) < 0) {
|
||||
i_errno = IESENDMESSAGE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user