Browse Source

[multiple] reduce use of BUFFER_INTLEN_PTR

reduce use of BUFFER_INTLEN_PTR where b->ptr known not to be NULL
master
Glenn Strauss 4 months ago
parent
commit
e6f286ef5f
  1. 10
      src/connections.c
  2. 12
      src/mod_maxminddb.c
  3. 3
      src/mod_webdav.c

10
src/connections.c

@ -1470,11 +1470,11 @@ static void connection_check_timeout (connection * const con, const time_t cur_t
/* time - out */
if (r->conf.log_timeouts) {
log_error(r->conf.errh, __FILE__, __LINE__,
"NOTE: a request from %.*s for %.*s timed out "
"NOTE: a request from %s for %.*s timed out "
"after writing %lld bytes. We waited %d seconds. "
"If this is a problem, increase "
"server.max-write-idle",
BUFFER_INTLEN_PTR(con->dst_addr_buf),
con->dst_addr_buf->ptr,
BUFFER_INTLEN_PTR(&r->target),
(long long)r->write_queue.bytes_out,
(int)r->conf.max_write_idle);
@ -1545,10 +1545,10 @@ static void connection_check_timeout (connection * const con, const time_t cur_t
/* time - out */
if (r->conf.log_timeouts) {
log_error(r->conf.errh, __FILE__, __LINE__,
"NOTE: a request from %.*s for %.*s timed out after writing "
"%lld bytes. We waited %d seconds. If this is a problem, "
"NOTE: a request from %s for %.*s timed out after writing "
"%lld bytes. We waited %d seconds. If this is a problem, "
"increase server.max-write-idle",
BUFFER_INTLEN_PTR(con->dst_addr_buf),
con->dst_addr_buf->ptr,
BUFFER_INTLEN_PTR(&r->target),
(long long)con->bytes_written, (int)r->conf.max_write_idle);
}

12
src/mod_maxminddb.c

@ -156,8 +156,8 @@ mod_maxminddb_open_db (server *srv, const buffer *db_name)
|| 0 != memcmp(db_name->ptr+db_name->used-sizeof(".mmdb"),
CONST_STR_LEN(".mmdb"))) {
log_error(srv->errh, __FILE__, __LINE__,
"GeoIP database is of unsupported type %.*s)",
BUFFER_INTLEN_PTR(db_name));
"GeoIP database is of unsupported type %s)",
db_name->ptr);
return NULL;
}
@ -168,12 +168,12 @@ mod_maxminddb_open_db (server *srv, const buffer *db_name)
if (MMDB_IO_ERROR == rc)
log_perror(srv->errh, __FILE__, __LINE__,
"failed to open GeoIP2 database (%.*s)",
BUFFER_INTLEN_PTR(db_name));
"failed to open GeoIP2 database (%s)",
db_name->ptr);
else
log_error(srv->errh, __FILE__, __LINE__,
"failed to open GeoIP2 database (%.*s): %s",
BUFFER_INTLEN_PTR(db_name), MMDB_strerror(rc));
"failed to open GeoIP2 database (%s): %s",
db_name->ptr, MMDB_strerror(rc));
free(mmdb);
return NULL;
}

3
src/mod_webdav.c

@ -539,8 +539,7 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
continue;
}
log_error(srv->errh, __FILE__, __LINE__,
"unrecognized webdav.opts: %.*s",
BUFFER_INTLEN_PTR(&ds->key));
"unrecognized webdav.opts: %s", ds->key.ptr);
return HANDLER_ERROR;
}
cpv->v.u = opts;

Loading…
Cancel
Save