1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Change the ap_cfg_getline() and ap_cfg_getc() to return an error code.

Also:
- Make ap_cfg_getline() return APR_ENOSPC if a config line is too long.
- Add ap_pcfg_strerror() function to convert ap_cfg_getline's return value
  into a nice message.
- Adjust definition of ap_configfile_t accordingly.

Not bumping MMN because it has already been bumped today.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086756 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Fritsch
2011-03-29 21:29:34 +00:00
parent d7ece730e9
commit 7b61bedb2f
6 changed files with 174 additions and 161 deletions

View File

@@ -317,8 +317,8 @@ static apr_size_t config_getstr(ap_configfile_t *cfg, char *buf,
apr_size_t i = 0;
if (cfg->getstr) {
const char *res = (cfg->getstr) (buf, bufsiz, cfg->param);
if (res) {
apr_status_t rc = (cfg->getstr) (buf, bufsiz, cfg->param);
if (rc == APR_SUCCESS) {
i = strlen(buf);
if (i && buf[i - 1] == '\n')
++cfg->line_number;
@@ -330,8 +330,9 @@ static apr_size_t config_getstr(ap_configfile_t *cfg, char *buf,
}
else {
while (i < bufsiz) {
int ch = (cfg->getch) (cfg->param);
if (ch == EOF)
char ch;
apr_status_t rc = (cfg->getch) (&ch, cfg->param);
if (rc != APR_SUCCESS)
break;
buf[i++] = ch;
if (ch == '\n') {