ext/nginx/CacheLocationConfig.c in passenger-5.0.10 vs ext/nginx/CacheLocationConfig.c in passenger-5.0.11

- old
+ new

@@ -1,8 +1,8 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2010-2014 Phusion + * Copyright (c) 2010-2015 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,12 +36,14 @@ * rake ext/nginx/CacheLocationConfig.c */ -size_t len = 0; -u_char int_buf[32], *end, *buf, *pos; +/* 0: NGX_ERROR, 1: OK */ +int generated_cache_location_part(ngx_conf_t *cf, passenger_loc_conf_t *conf) { + size_t len = 0; + u_char int_buf[32], *end, *buf, *pos; /* Calculate lengths */ if (conf->ruby.data != NULL) { @@ -302,11 +304,11 @@ /* Create string */ buf = pos = ngx_pnalloc(cf->pool, len); if (buf == NULL) { - return NGX_ERROR; + return 0; } if (conf->ruby.data != NULL) { @@ -662,7 +664,10 @@ pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1); } -conf->options_cache.data = buf; -conf->options_cache.len = pos - buf; + conf->options_cache.data = buf; + conf->options_cache.len = pos - buf; + + return 1; +}