changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > ventivac / changeset: fix bug: vcache would deference nil pointer for some cases of incoming Rwrite from proxy.

changeset 53: a85e74e20558
parent 52: b2aa6f915c71
child 54: 6b2cbb1f52b6
author: Mechiel Lukkien <mechiel@ueber.net>
date: Fri, 13 Jul 2007 12:59:44 +0200
files: appl/cmd/vcache.b
description: fix bug: vcache would deference nil pointer for some cases of incoming Rwrite from proxy.
     1.1--- a/appl/cmd/vcache.b	Fri Jul 13 12:44:19 2007 +0200
     1.2+++ b/appl/cmd/vcache.b	Fri Jul 13 12:59:44 2007 +0200
     1.3@@ -413,6 +413,7 @@
     1.4 		rscore := Score(sha1(msg.data));
     1.5 		return rscore.eq(*op.s);
     1.6 	Rwrite =>
     1.7+verbose(sprint("opokay, msg.score=%s op.s nil==%d", msg.score.text(), op.s==nil));
     1.8 		return msg.score.eq(*op.s);
     1.9 	};
    1.10 	return 1;
    1.11@@ -681,7 +682,7 @@
    1.12 				cacheput(*op.s, op.dtype, r.data);
    1.13 				isread = 1;
    1.14 				if(proxyaddr != nil && needconn(proxy, nil) >= 0) {
    1.15-					ptid := proxy.opput(ref Op(0, nil, 0, nil, Nothing, nil, 0, 0));
    1.16+					ptid := proxy.opput(ref Op(0, nil, 0, nil, Nothing, op.s, 0, 0));
    1.17 					proxy.writec <-= ref Vmsg.Twrite(1, ptid, op.dtype, r.data);
    1.18 					if(dflag) debug("central: wrote data from remote to proxy");
    1.19 				}