@@ -431,10 +431,11 @@ static ngx_int_t ngx_http_mongo_authenticate(ngx_log_t *log, ngx_http_gridfs_loc
431
431
432
432
// Authenticate
433
433
if (gridfs_loc_conf -> user .data != NULL && gridfs_loc_conf -> pass .data != NULL ) {
434
- if (!mongo_cmd_authenticate ( & mongo_conn -> conn ,
435
- (const char * )gridfs_loc_conf -> db .data ,
436
- (const char * )gridfs_loc_conf -> user .data ,
437
- (const char * )gridfs_loc_conf -> pass .data )) {
434
+ if (mongo_cmd_authenticate ( & mongo_conn -> conn ,
435
+ (const char * )gridfs_loc_conf -> db .data ,
436
+ (const char * )gridfs_loc_conf -> user .data ,
437
+ (const char * )gridfs_loc_conf -> pass .data )
438
+ != MONGO_OK ) {
438
439
ngx_log_error (NGX_LOG_ERR , log , 0 ,
439
440
"Invalid mongo user/pass: %s/%s" ,
440
441
gridfs_loc_conf -> user .data ,
@@ -609,15 +610,16 @@ static ngx_int_t ngx_http_mongo_reconnect(ngx_log_t *log, ngx_http_mongo_connect
609
610
610
611
static ngx_int_t ngx_http_mongo_reauth (ngx_log_t * log , ngx_http_mongo_connection_t * mongo_conn ) {
611
612
ngx_http_mongo_auth_t * auths ;
612
- volatile ngx_uint_t i , success = 0 ;
613
+ volatile ngx_uint_t i ;
614
+ volatile ngx_int_t status = 0 ;
613
615
auths = mongo_conn -> auths -> elts ;
614
616
615
617
for (i = 0 ; i < mongo_conn -> auths -> nelts ; i ++ ) {
616
- success = mongo_cmd_authenticate ( & mongo_conn -> conn ,
617
- (const char * )auths [i ].db .data ,
618
- (const char * )auths [i ].user .data ,
619
- (const char * )auths [i ].pass .data );
620
- if (! success ) {
618
+ status = mongo_cmd_authenticate ( & mongo_conn -> conn ,
619
+ (const char * )auths [i ].db .data ,
620
+ (const char * )auths [i ].user .data ,
621
+ (const char * )auths [i ].pass .data );
622
+ if (status != MONGO_OK ) {
621
623
ngx_log_error (NGX_LOG_ERR , log , 0 ,
622
624
"Invalid mongo user/pass: %s/%s, during reauth" ,
623
625
auths [i ].user .data ,
0 commit comments