[CXX-446] ConnectionString doesn't work with UNIX socket format Created: 11/Dec/14  Updated: 19/Dec/14  Resolved: 11/Dec/14

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: legacy-1.0.0-rc2
Fix Version/s: legacy-1.0.0-rc3

Type: Improvement Priority: Critical - P2
Reporter: Pieter Jordaan Assignee: Tyler Brock
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

UNIX-based



 Description   

mongodb:///tmp/mongodb-27017.sock

This should be a valid string, instead an assert is fired in the constructor of the ConnectionString here:

ConnectionString( ConnectionType type,
                          const std::string& user,
                          const std::string& password,
                          const std::string& servers,
                          const std::string& database,
                          const std::string& setName,
                          const BSONObj& options )
            : _type( type )
            , _servers( )
            , _setName( setName )
            , _user( user )
            , _password( password )
            , _database( database )
            , _options( options ) {
 
            _fillServers( servers );
            switch ( _type ) {
            case MASTER:
                verify( _servers.size() == 1 );
                break;
            case SET:
                verify( _setName.size() ); // ->HERE
                verify( _servers.size() >= 1 ); // 1 is ok since we can derive
                break;
            case PAIR:
                verify( _servers.size() == 2 );
                break;
            default:
                verify( _servers.size() > 0 );
            }
 
            _finishInit();



 Comments   
Comment by Githook User [ 11/Dec/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: CXX-446 allow unix sockets in non-legacy uris
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/727db0a741b37f738d6405e7691c90ad85a60a0f

Comment by Tyler Brock [ 11/Dec/14 ]

https://github.com/mongodb/mongo-cxx-driver/pull/216

Comment by Andrew Morrow (Inactive) [ 11/Dec/14 ]

Hi pieterwjordaanpc@gmail.com -

Thank you for the bug report. We have reproduced this issue locally and will be working on a fix.

We appreciate your taking the time to test our release candidates and reporting the issues that you find.

Generated at Wed Feb 07 21:59:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.