File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,19 @@ BSON_BEGIN_DECLS
49
49
#endif
50
50
51
51
52
+ #ifndef MONGOC_DEFAULT_SOCKETTIMEOUTMS
53
+ /*
54
+ * NOTE: The default socket timeout for connections is 5 minutes. This
55
+ * means that if your MongoDB server dies or becomes unavailable
56
+ * it will take 5 minutes to detect this.
57
+ *
58
+ * You can change this by providing sockettimeoutms= in your
59
+ * connection URI.
60
+ */
61
+ #define MONGOC_DEFAULT_SOCKETTIMEOUTMS (1000L * 60L * 5L)
62
+ #endif
63
+
64
+
52
65
/**
53
66
* mongoc_client_t:
54
67
*
Original file line number Diff line number Diff line change 66
66
#define CHECK_CLOSED_DURATION_MSEC 1000
67
67
68
68
69
- #ifndef DEFAULT_SOCKET_TIMEOUT_MSEC
70
- /*
71
- * NOTE: The default socket timeout for connections is 5 minutes. This
72
- * means that if your MongoDB server dies or becomes unavailable
73
- * it will take 5 minutes to detect this.
74
- *
75
- * You can change this by providing sockettimeoutms= in your
76
- * connection URI.
77
- */
78
- #define DEFAULT_SOCKET_TIMEOUT_MSEC (1000L * 60L * 5L)
79
- #endif
80
-
81
-
82
69
#ifndef UNHEALTHY_RECONNECT_TIMEOUT_USEC
83
70
/*
84
71
* Try reconnect every 20 seconds if we are unhealthy.
@@ -484,7 +471,7 @@ _mongoc_cluster_init (mongoc_cluster_t *cluster,
484
471
{
485
472
const mongoc_host_list_t * hosts ;
486
473
const mongoc_host_list_t * host_iter ;
487
- uint32_t sockettimeoutms = DEFAULT_SOCKET_TIMEOUT_MSEC ;
474
+ uint32_t sockettimeoutms = MONGOC_DEFAULT_SOCKETTIMEOUTMS ;
488
475
uint32_t i ;
489
476
const bson_t * b ;
490
477
bson_iter_t iter ;
@@ -513,7 +500,7 @@ _mongoc_cluster_init (mongoc_cluster_t *cluster,
513
500
514
501
if (bson_iter_init_find_case (& iter , b , "sockettimeoutms" )) {
515
502
if (!(sockettimeoutms = bson_iter_int32 (& iter ))) {
516
- sockettimeoutms = DEFAULT_SOCKET_TIMEOUT_MSEC ;
503
+ sockettimeoutms = MONGOC_DEFAULT_SOCKETTIMEOUTMS ;
517
504
}
518
505
}
519
506
You can’t perform that action at this time.
0 commit comments