Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Feb 20, 2012

This pull requests makes sure that chunks are removed when the gridfs meta file record can not be added (due to f.e. index issues). It also forces safe mode for the insertion of the gridfs meta file record.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to separate the zval to not modify the original array here?

Infact.. I don't see where the input argument is ever forced as array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mon, 20 Feb 2012, Hannes Magnusson wrote:

@@ -383,14 +430,30 @@ static void add_md5(zval *zfile, zval *zid, mongo_collection *c TSRMLS_DC) {
add_assoc_long(zfile, "length", bytes_len);
}

  • // options
  • if (!options) {
  •   zval *opts;
    
  •   MAKE_STD_ZVAL(opts);
    
  •   array_init(opts);
    
  •   options = opts;
    
  •   free_options = 1;
    
  • }
  • // force safe mode
  • add_assoc_long(options, "safe", 1);

Don't you need to separate the zval to not modify the original array here?

Hmm, good point :-)

Infact.. I don't see where the input argument is ever forced as array?

Also a good point. I noticed that in a lot of cases just a "z" is used
and not the actual. In this case however, changing "s|az" tp "s|as"
would be correct.

cheers,
Derick

http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

…sure we only accept array zvals for options.
derickr added a commit that referenced this pull request Feb 22, 2012
@derickr derickr merged commit f48c0c7 into mongodb:v1.2 Feb 22, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants