| 2349 | */ |
| 2350 | |
| 2351 | int |
| 2352 | iperf_exchange_parameters(struct iperf_test *test) |
| 2353 | { |
| 2354 | int s; |
| 2355 | |
| 2356 | if (test->role == 'c') { |
| 2357 | |
| 2358 | if (send_parameters(test) < 0) |
| 2359 | return -1; |
| 2360 | |
| 2361 | } else { |
| 2362 | |
| 2363 | if (get_parameters(test) < 0) { |
| 2364 | return -1; |
| 2365 | } |
| 2366 | |
| 2367 | #if defined(HAVE_SSL) |
| 2368 | if (test_is_authorized(test) < 0){ |
| 2369 | return -1; |
| 2370 | } |
| 2371 | #endif //HAVE_SSL |
| 2372 | |
| 2373 | if ((s = test->protocol->listen(test)) < 0) { |
| 2374 | return -1; |
| 2375 | } |
| 2376 | |
| 2377 | FD_SET(s, &test->read_set); |
| 2378 | test->max_fd = (s > test->max_fd) ? s : test->max_fd; |
| 2379 | test->prot_listener = s; |
| 2380 | |
| 2381 | // Send the control message to create streams and start the test |
| 2382 | if (iperf_set_send_state(test, CREATE_STREAMS) != 0) |
| 2383 | return -1; |
| 2384 | |
| 2385 | } |
| 2386 | |
| 2387 | return 0; |
| 2388 | } |
| 2389 | |
| 2390 | /*************************************************************/ |
| 2391 |
no test coverage detected
searching dependent graphs…