MCPcopy Create free account
hub / github.com/RsyncProject/rsync / send_negotiate_str

Function send_negotiate_str

compat.c:506–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506static 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
535static void negotiate_the_strings(int f_in, int f_out)
536{

Callers 1

negotiate_the_stringsFunction · 0.85

Calls 6

getenv_nstrFunction · 0.85
init_nno_sawFunction · 0.85
parse_nni_strFunction · 0.85
get_default_nno_listFunction · 0.85
write_vstringFunction · 0.85
rprintfFunction · 0.70

Tested by

no test coverage detected