-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-600: Use mongoc_client_get_server_descriptions() to get Manager's Servers #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think this is enough. There is another After make that change as well, you will see |
add_next_index_zval(return_value, obj); | ||
#endif | ||
} | ||
|
||
mongoc_server_descriptions_destroy_all(sds, n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derickr: I believe mongodb/mongo-hhvm-driver#78 was missing this. Can you confirm if you're leaking memory via the array returned from mongoc_client_get_server_descriptions()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened HHVM-215 to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct: mongodb/mongo-hhvm-driver#90
ee91a1f
to
165ed2b
Compare
|
||
phongo_server_init(obj, intern->client, sd->id TSRMLS_CC); | ||
MAKE_STD_ZVAL(obj); | ||
phongo_server_init(obj, intern->client, mongoc_server_description_id(sds[i]) TSRMLS_CC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need the method call mongoc_server_description_id(sds[i])
here? I believe, sds[i]->id
should be safe too? As far as I know, the server_description_t
type is public. Otherwise php_phongo_server_to_zval
would not work at all either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mongoc-server-description.h
only defines:
typedef struct _mongoc_server_description_t mongoc_server_description_t;
_mongoc_server_description_t
is defined in mongoc-server-description-private.h
. I noticed that Manager.c
was still including mongoc-server-description-private.h
, so I've removed it and amended the commit. Any headers I don't catch in these PRs will ultimately be removed in PHPC-665, which should be the final test that we're abiding the public API.
FYI: php_phongo_server_to_zval()
is being migrated to the public API in #291 for PHPC-606.
LGTM |
https://jira.mongodb.org/browse/PHPC-600