Skip to content

Conversation

@maskit
Copy link
Member

@maskit maskit commented Jun 8, 2020

PRId64 doesn't work for time_t on macOS.

This page uses "%jd", and it works for me.
https://en.cppreference.com/w/c/chrono/time_t

@maskit maskit added the Plugins label Jun 8, 2020
@maskit maskit added this to the 10.0.0 milestone Jun 8, 2020
@maskit maskit requested review from ezelkow1, traeak and zwoop June 8, 2020 05:29
@maskit maskit self-assigned this Jun 8, 2020
@maskit
Copy link
Member Author

maskit commented Jun 8, 2020

[approve ci autest]

Copy link
Contributor

@traeak traeak left a comment

Choose a reason for hiding this comment

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

It's probably okay although perhaps we should technically use the "difftime" api which is guaranteed to return a double. I've seen "mishandling" of time_t in other places in the code.

@traeak
Copy link
Contributor

traeak commented Jun 8, 2020

[approve ci autest]

1 similar comment
@shinrich
Copy link
Member

shinrich commented Jun 8, 2020

[approve ci autest]

@maskit
Copy link
Member Author

maskit commented Jun 9, 2020

Yeah, you're probably right. I didn't read the code that much and just fixed the compile errors because it blocks my daily work. I'd like to leave the future improvement to people who maintain the plugins.

@maskit maskit merged commit dde3897 into apache:master Jun 9, 2020
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
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
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.

traeak pushed a commit to traeak/trafficserver that referenced this pull request Jan 19, 2021
zwoop pushed a commit that referenced this pull request Jan 20, 2021
* Slice plugin: recover out of sync slices, better handling of non 206s (#6691)

The very first slice is used as the reference slice to make recovery easiest.
Recover asset where slices differ in  content-length, etag, last-modified.
autests included to cover basic functionality.

Includes additions to include/ts/experimental.h:

tsapi time_t TSMimeParseDate(char const *const value_str, int const value_len);
tsapi TSReturnCode TSMimeFormatDate(time_t const value_time, char *const value_str, int *const value_len);

These are derived from TSMimeHdrFieldValueDateSet/TSMimeHdrFieldValueDateGet.

(cherry picked from commit 6dd31eb)

* Make format specifier for time_t portable (#6860)

(cherry picked from commit dde3897)

* autest whitespace

* slice: clean up of created 502 response header (#6919)

Change header debug to use TSHttpHdrPrint.

Co-authored-by: Brian Olsen <[email protected]>
(cherry picked from commit 9d23ab6)

* default to throttling and subsequently simplify the transfer code (#7257)

slice: default to throttling, 416 changes and bug fix for downstream closing.
(cherry picked from commit 4462484)

Co-authored-by: Masakazu Kitajo <[email protected]>
@zwoop zwoop modified the milestones: 10.0.0, 9.0.1 Jan 20, 2021
@zwoop
Copy link
Contributor

zwoop commented Jan 20, 2021

Backported to 9.0.1 in #7435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants