Another potentially protocol-breaking but necessary change.
The error numbers sent for SERVER_ERROR state were declared as ints, and therefore could be 32 or 64 bits depending on architecture. I changed them to be explicitly 32 bits. This should be the last of these, I've checked out at every network read/write call and they look ok. And bumped the version to 3.0-RC5.
Этот коммит содержится в:
родитель
8115b2a26e
Коммит
d2b9eb1a87
@ -909,7 +909,8 @@ iperf_create_send_timers(struct iperf_test * test)
|
||||
int
|
||||
iperf_exchange_parameters(struct iperf_test *test)
|
||||
{
|
||||
int s, msg;
|
||||
int s;
|
||||
int32_t err;
|
||||
|
||||
if (test->role == 'c') {
|
||||
|
||||
@ -924,13 +925,13 @@ iperf_exchange_parameters(struct iperf_test *test)
|
||||
if ((s = test->protocol->listen(test)) < 0) {
|
||||
if (iperf_set_send_state(test, SERVER_ERROR) != 0)
|
||||
return -1;
|
||||
msg = htonl(i_errno);
|
||||
if (Nwrite(test->ctrl_sck, (char*) &msg, sizeof(msg), Ptcp) < 0) {
|
||||
err = htonl(i_errno);
|
||||
if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
|
||||
i_errno = IECTRLWRITE;
|
||||
return -1;
|
||||
}
|
||||
msg = htonl(errno);
|
||||
if (Nwrite(test->ctrl_sck, (char*) &msg, sizeof(msg), Ptcp) < 0) {
|
||||
err = htonl(errno);
|
||||
if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
|
||||
i_errno = IECTRLWRITE;
|
||||
return -1;
|
||||
}
|
||||
|
@ -168,7 +168,8 @@ create_client_omit_timer(struct iperf_test * test)
|
||||
int
|
||||
iperf_handle_message_client(struct iperf_test *test)
|
||||
{
|
||||
int rval, perr;
|
||||
int rval;
|
||||
int32_t err;
|
||||
|
||||
if ((rval = read(test->ctrl_sck, (char*) &test->state, sizeof(signed char))) <= 0) {
|
||||
if (rval == 0) {
|
||||
@ -222,16 +223,16 @@ iperf_handle_message_client(struct iperf_test *test)
|
||||
i_errno = IEACCESSDENIED;
|
||||
return -1;
|
||||
case SERVER_ERROR:
|
||||
if (Nread(test->ctrl_sck, (char*) &i_errno, sizeof(i_errno), Ptcp) < 0) {
|
||||
if (Nread(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
|
||||
i_errno = IECTRLREAD;
|
||||
return -1;
|
||||
}
|
||||
i_errno = ntohl(i_errno);
|
||||
if (Nread(test->ctrl_sck, (char*) &perr, sizeof(perr), Ptcp) < 0) {
|
||||
i_errno = ntohl(err);
|
||||
if (Nread(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) {
|
||||
i_errno = IECTRLREAD;
|
||||
return -1;
|
||||
}
|
||||
errno = ntohl(perr);
|
||||
errno = ntohl(err);
|
||||
return -1;
|
||||
default:
|
||||
i_errno = IEMESSAGE;
|
||||
|
@ -7,5 +7,5 @@
|
||||
* for complete information.
|
||||
*/
|
||||
|
||||
#define IPERF_VERSION "3.0-RC4"
|
||||
#define IPERF_VERSION_DATE "06 November 2013"
|
||||
#define IPERF_VERSION "3.0-RC5"
|
||||
#define IPERF_VERSION_DATE "07 November 2013"
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user