Commit 3fe0d1d9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Get refcounting and testing thereoff correct in std.fileread()

parent cd0d4954
...@@ -76,10 +76,7 @@ varnish v1 -cli "vcl.list" ...@@ -76,10 +76,7 @@ varnish v1 -cli "vcl.list"
varnish v1 -cli "vcl.discard vcl1" varnish v1 -cli "vcl.discard vcl1"
varnish v1 -vcl+backend { } varnish v1 -vcl+backend { }
varnish v1 -cli "vcl.use vcl3"
varnish v1 -cli "vcl.list"
varnish v1 -cli "vcl.discard vcl2"
client c1 { client c1 {
txreq -url "/one" txreq -url "/one"
...@@ -91,3 +88,8 @@ client c1 { ...@@ -91,3 +88,8 @@ client c1 {
} -run } -run
varnish v1 -cli "vcl.list" varnish v1 -cli "vcl.list"
varnish v1 -cli "vcl.discard vcl2"
client c1 -run
varnish v1 -cli "vcl.list"
...@@ -37,12 +37,7 @@ ...@@ -37,12 +37,7 @@
* XXX: underlying file has been updated. * XXX: underlying file has been updated.
*/ */
#include <fcntl.h>
#include <pthread.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "vrt.h" #include "vrt.h"
#include "../../bin/varnishd/cache.h" #include "../../bin/varnishd/cache.h"
...@@ -101,8 +96,11 @@ vmod_fileread(struct sess *sp, struct vmod_priv *priv, const char *file_name) ...@@ -101,8 +96,11 @@ vmod_fileread(struct sess *sp, struct vmod_priv *priv, const char *file_name)
} }
} }
AZ(pthread_mutex_unlock(&frmtx)); AZ(pthread_mutex_unlock(&frmtx));
if (frf != NULL) if (frf != NULL) {
priv->free = free_frfile;
priv->priv = frf;
return (frf->contents); return (frf->contents);
}
s = vreadfile(NULL, file_name, NULL); s = vreadfile(NULL, file_name, NULL);
if (s != NULL) { if (s != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment