|
21 | 21 | #include "mongoc-stream-gridfs-download-private.h"
|
22 | 22 | #include "mongoc-stream-gridfs-upload-private.h"
|
23 | 23 | #include "mongoc-collection-private.h"
|
| 24 | +#include "mongoc-util-private.h" |
24 | 25 |
|
25 | 26 | /* Returns the minimum of two numbers */
|
26 | 27 | static size_t
|
@@ -369,7 +370,9 @@ _mongoc_gridfs_bucket_file_writev (mongoc_gridfs_bucket_file_t *file,
|
369 | 370 | #ifndef _WIN32
|
370 | 371 | (char *)
|
371 | 372 | #endif
|
372 |
| - iov[i].iov_base + written_this_iov, |
| 373 | + iov[i] |
| 374 | + .iov_base + |
| 375 | + written_this_iov, |
373 | 376 | to_write);
|
374 | 377 | file->in_buffer += to_write;
|
375 | 378 | written_this_iov += to_write;
|
@@ -420,11 +423,13 @@ _mongoc_gridfs_bucket_file_readv (mongoc_gridfs_bucket_file_t *file,
|
420 | 423 | to_read = _mongoc_min (bytes_available, space_available);
|
421 | 424 | memcpy (
|
422 | 425 | #ifndef _WIN32
|
423 |
| - (char *) |
| 426 | + (char *) |
424 | 427 | #endif
|
425 |
| - iov[i].iov_base + read_this_iov, |
426 |
| - file->buffer + file->bytes_read, |
427 |
| - to_read); |
| 428 | + iov[i] |
| 429 | + .iov_base + |
| 430 | + read_this_iov, |
| 431 | + file->buffer + file->bytes_read, |
| 432 | + to_read); |
428 | 433 | file->bytes_read += to_read;
|
429 | 434 | read_this_iov += to_read;
|
430 | 435 | total += to_read;
|
@@ -491,7 +496,7 @@ _mongoc_gridfs_bucket_file_save (mongoc_gridfs_bucket_file_t *file)
|
491 | 496 | BSON_APPEND_VALUE (&new_doc, "_id", file->file_id);
|
492 | 497 | BSON_APPEND_INT64 (&new_doc, "length", file->length);
|
493 | 498 | BSON_APPEND_INT32 (&new_doc, "chunkSize", file->chunk_size);
|
494 |
| - BSON_APPEND_DATE_TIME (&new_doc, "uploadDate", bson_get_monotonic_time ()); |
| 499 | + BSON_APPEND_DATE_TIME (&new_doc, "uploadDate", _mongoc_get_real_time_ms ()); |
495 | 500 | BSON_APPEND_UTF8 (&new_doc, "filename", file->filename);
|
496 | 501 | if (file->metadata) {
|
497 | 502 | BSON_APPEND_DOCUMENT (&new_doc, "metadata", file->metadata);
|
|
0 commit comments