| 504 | } |
| 505 | |
| 506 | static void send_negotiate_str(int f_out, struct name_num_obj *nno, int ntype) |
| 507 | { |
| 508 | char tmpbuf[MAX_NSTR_STRLEN]; |
| 509 | const char *list_str = getenv_nstr(ntype); |
| 510 | int len; |
| 511 | |
| 512 | if (list_str && *list_str) { |
| 513 | init_nno_saw(nno, 0); |
| 514 | len = parse_nni_str(nno, list_str, tmpbuf, MAX_NSTR_STRLEN); |
| 515 | list_str = tmpbuf; |
| 516 | } else |
| 517 | list_str = NULL; |
| 518 | |
| 519 | if (!list_str || !*list_str) |
| 520 | len = get_default_nno_list(nno, tmpbuf, MAX_NSTR_STRLEN, '\0'); |
| 521 | |
| 522 | if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) { |
| 523 | if (am_server) |
| 524 | rprintf(FINFO, "Server %s list (on server): %s\n", nno->type, tmpbuf); |
| 525 | else |
| 526 | rprintf(FINFO, "Client %s list (on client): %s\n", nno->type, tmpbuf); |
| 527 | } |
| 528 | |
| 529 | /* Each side sends their list of valid names to the other side and then both sides |
| 530 | * pick the first name in the client's list that is also in the server's list. */ |
| 531 | if (do_negotiated_strings) |
| 532 | write_vstring(f_out, tmpbuf, len); |
| 533 | } |
| 534 | |
| 535 | static void negotiate_the_strings(int f_in, int f_out) |
| 536 | { |
no test coverage detected