This adds range checking to Timestamp's constructor and changes Timestamp::__toString() to print the components as unsigned 32-bit integers. Internal structs and functions were changed to use uint32_t for readability.
32-bit platforms will be limited to the range of signed 32-bit integers, since PHP has no unsigned integer type. This will be documented in PHPC-599.
executeCommand(), executeQuery(), and selectServer() did not check for a global exception after executing via libmongoc, which meant that connection and SSL exceptions might end up as the previous exception where they could be easily ignored.
This makes these methods consistent with executeBulkWrite(), which happens to be used in our SSL tests where we check for such exceptions.
This allows PHP's warnings during connection initialization (e.g. unresolvable host names) to be captured into the bson_error_t, which is later used to throw an exception.
Since ADD_ASSOC_STRINGL() always duplicates, use a static buffer in UTCDateTime's debug handler when converting milliseconds to a string on 32-bit platforms.
This simplifies calling bson_to_zval() quite a bit.
bson_to_zval() now takes empty zval*
bson_to_zval_ex() now takes php_phongo_bson_state (with empty zval*)
bson_to_zval() will always alloc and init state.zchild
When doing async connections we can't properly determine if we should connect over IPv6 or IPv4. PHP will unfortunately default to connecting over IPv6 (when compiled in support, with minor runtime check), while mongod does not support IPv6 by default.
When then creating the IPv6 connection asynchronously, PHP hits EINPROGRESS and will happily return the socket as valid.
There currently is no way to configure these functions to prefer IPv4. The best we can do for now is to not connect asynchronously as then we'll properly discover that the IPv6 socket failed, and then continue through the list of addrinfo and next pickup the IPv4 address which works.
Fixes#133