Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/cache_range_requests/cache_range_requests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ handle_cache_lookup_complete(TSHttpTxn txnp, txndata *const txn_state)
if (TS_SUCCESS == TSHttpTxnCacheLookupStatusGet(txnp, &cachestat)) {
if (TS_CACHE_LOOKUP_HIT_FRESH == cachestat) {
time_t const ch_time = get_date_from_cached_hdr(txnp);
DEBUG_LOG("IMS Cached header time %" PRId64 " vs IMS %" PRId64, ch_time, txn_state->ims_time);
DEBUG_LOG("IMS Cached header time %jd vs IMS %jd", static_cast<intmax_t>(ch_time),
static_cast<intmax_t>(txn_state->ims_time));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer to cast to intmax_t then why not use PRIdMAX as the format specifier? https://en.cppreference.com/w/cpp/header/cinttypes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not my preference. Just because Google navigated me to the example and it worked.

if (ch_time < txn_state->ims_time) {
TSHttpTxnCacheLookupStatusSet(txnp, TS_CACHE_LOOKUP_HIT_STALE);
if (TSIsDebugTagSet(PLUGIN_NAME)) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/slice/HttpHeader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ HttpHeader::setKeyTime(char const *const keystr, int const keylen, time_t const
if (TS_SUCCESS == TSMimeHdrFieldValueDateSet(m_buffer, m_lochdr, locfield, timeval)) {
if (TS_SUCCESS == TSMimeHdrFieldAppend(m_buffer, m_lochdr, locfield)) {
status = true;
DEBUG_LOG("Set header %.*s to %" PRId64, keylen, keystr, timeval);
DEBUG_LOG("Set header %.*s to %jd", keylen, keystr, static_cast<intmax_t>(timeval));
}
}
TSHandleMLocRelease(m_buffer, m_lochdr, locfield);
Expand Down
8 changes: 4 additions & 4 deletions plugins/experimental/slice/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ logSliceError(char const *const message, Data const *const data, HttpHeader cons
" status_got=\"%d\""
" cr_got=\"%.*s\""
" etag_got=\"%.*s\""
" lm_got=\"%" PRId64 "\""
" lm_got=\"%jd\""
" cc=\"%.*s\""
" via=\"%.*s\" - attempting to recover",
secs, ms, message, (int)urlplen, urlpstr, uaslen, uasstr, rangelen, rangestr, normlen, normstr, (int)etagexplen,
etagexpstr, data->m_lastmodifiedlen, data->m_lastmodified, blockbeg, blockend - 1, statusgot, crlen, crstr,
(int)etaggotlen, etaggotstr, lmgot, cclen, ccstr, vialen, viastr);
(int)etaggotlen, etaggotstr, static_cast<intmax_t>(lmgot), cclen, ccstr, vialen, viastr);
}

bool
Expand Down Expand Up @@ -426,7 +426,7 @@ handleNextServerHeader(Data *const data, TSCont const contp)
// Ask for any slice newer than the cached one
time_t const dateims = date + 1;

DEBUG_LOG("Attempting to reissue interior slice block request with IMS header time: %" PRId64, dateims);
DEBUG_LOG("Attempting to reissue interior slice block request with IMS header time: %jd", static_cast<intmax_t>(dateims));

// add special CRR IMS header to the request
HttpHeader headerreq(data->m_req_hdrmgr.m_buffer, data->m_req_hdrmgr.m_lochdr);
Expand All @@ -448,7 +448,7 @@ handleNextServerHeader(Data *const data, TSCont const contp)
// Ask for any slice newer than the cached one
time_t const dateims = date + 1;

DEBUG_LOG("Attempting to reissue reference slice block request with IMS header time: %" PRId64, dateims);
DEBUG_LOG("Attempting to reissue reference slice block request with IMS header time: %jd", static_cast<intmax_t>(dateims));

// add special CRR IMS header to the request
HttpHeader headerreq(data->m_req_hdrmgr.m_buffer, data->m_req_hdrmgr.m_lochdr);
Expand Down