| 1 | Patch by Robin Mueller
|
| 2 |
|
| 3 | The strftime method of the libmusl writes 'UTC' instead of 'GMT' when
|
| 4 | the character Z is used in the format pattern, and it looks like the
|
| 5 | S3 clients don't like 'UTC' in the date strings.
|
| 6 |
|
| 7 | This patch replaces 'UTC' with 'GMT' at the relevant location.
|
| 8 |
|
| 9 | |
| 10 | |
| 11 | @@ -436,8 +436,21 @@
|
| 12 | return 0;
|
| 13 | }
|
| 14 |
|
| 15 | - return strftime(timestr, sizeof(timestr),
|
| 16 | - "%a, %d %b %Y %H:%M:%S %Z", tmp);
|
| 17 | + size_t len = strftime(timestr, sizeof(timestr),
|
| 18 | + "%a, %d %b %Y %H:%M:%S %Z", tmp);
|
| 19 | +
|
| 20 | + int position = 0;
|
| 21 | + while (timestr[position] != 'U' && len - position > 3)
|
| 22 | + position++;
|
| 23 | +
|
| 24 | + if (len - position == 3) {
|
| 25 | + char substr[4];
|
| 26 | + memcpy(substr, ×tr[position], 4);
|
| 27 | +
|
| 28 | + if (strcmp(substr, "UTC") == 0)
|
| 29 | + memcpy(×tr[position], "GMT", 3);
|
| 30 | + }
|
| 31 | + return len;
|
| 32 | }
|
| 33 |
|
| 34 | void dump_time_header(struct req_state *s, const char *name, real_time t)
|