Commits

Aristarkh Zagorodnikov committed d40b03b

Removed unnecessary brigade cleanup (it's allocated from the request pool and will be cleaned up when request is finished)

  • Participants
  • Parent commits 3e30992
  • Branches v0.2

Comments (0)

Files changed (1)

File gridfs/mod_gridfs.cpp

 						{
 							connection->done();
 							ap_log_rerror(APLOG_MARK, APLOG_ERR, result, request, "mod_gridfs: Failed to write chunk %d for file '%s' to brigade (length: %d).", chunk_index, filename, chunk_length); 
-							apr_brigade_destroy(brigade);
-							brigade = 0;
 							return HTTP_INTERNAL_SERVER_ERROR;
 						}
 						content_length += chunk_length;
 					{
 						connection->done();
 						ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, result, request, "mod_gridfs: Mismatching files/chunks length for file '%s' (difference: %d).", filename, static_cast<int>(file_length - content_length));
-						apr_brigade_destroy(brigade);
-						brigade = 0;
 						return HTTP_INTERNAL_SERVER_ERROR;
 					}
 				}
 	catch (const mongo::DBException& exception)
 	{
 		ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, request, "mod_gridfs: Unhandled MongoDB exception occured for file '%s' (code: %d): %s.", filename, exception.getCode(), exception.what()); 
-		if (brigade != 0)
-			apr_brigade_destroy(brigade);
 		return HTTP_INTERNAL_SERVER_ERROR;
 	}
 	catch (const std::exception& exception)
 	{
 		ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, request, "mod_gridfs: Unhandled exception occured for file '%s': %s.", filename, exception.what()); 
-		if (brigade != 0)
-			apr_brigade_destroy(brigade);
 		return HTTP_INTERNAL_SERVER_ERROR;
 	}
 	catch (...)
 	{
 		ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, request, "mod_gridfs: Unknown unhandled exception occured for file '%s'.", filename); 
-		if (brigade != 0)
-			apr_brigade_destroy(brigade);
 		return HTTP_INTERNAL_SERVER_ERROR;
 	}
 	if (brigade != 0)