infof: remove newline from format strings, always append it

- the data needs to be "line-based" anyway since it's also passed to the
  debug callback/application

- it makes infof() work like failf() and consistency is good

- there's an assert that triggers on newlines in the format string

- Also removes a few instances of "..."

- Removes the code that would append "..." to the end of the data *iff*
  it was truncated in infof()

Closes #7357
This commit is contained in:
Daniel Stenberg 2021-07-06 17:05:17 +02:00
parent 1026b36ea0
commit e7416cfd2b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
69 changed files with 936 additions and 947 deletions

View file

@ -268,9 +268,9 @@ static void printoption(struct Curl_easy *data,
if(data->set.verbose) {
if(cmd == CURL_IAC) {
if(CURL_TELCMD_OK(option))
infof(data, "%s IAC %s\n", direction, CURL_TELCMD(option));
infof(data, "%s IAC %s", direction, CURL_TELCMD(option));
else
infof(data, "%s IAC %d\n", direction, option);
infof(data, "%s IAC %d", direction, option);
}
else {
const char *fmt = (cmd == CURL_WILL) ? "WILL" :
@ -287,12 +287,12 @@ static void printoption(struct Curl_easy *data,
opt = NULL;
if(opt)
infof(data, "%s %s %s\n", direction, fmt, opt);
infof(data, "%s %s %s", direction, fmt, opt);
else
infof(data, "%s %s %d\n", direction, fmt, option);
infof(data, "%s %s %d", direction, fmt, option);
}
else
infof(data, "%s %d %d\n", direction, cmd, option);
infof(data, "%s %d %d", direction, cmd, option);
}
}
}
@ -765,8 +765,6 @@ static void printsub(struct Curl_easy *data,
break;
}
}
if(direction)
infof(data, "\n");
}
}