[prev in list] [next in list] [prev in thread] [next in thread]
List: varnish-commit
Subject: [master] 3136e23 Don't forget to handle OIS_ERROR
From: Poul-Henning Kamp <phk () FreeBSD ! org>
Date: 2013-12-18 12:10:14
Message-ID: E1VtFx8-0000xg-DR () project ! varnish-software ! com
[Download RAW message or body]
commit 3136e23c611da56ea1537241517d8077667cf4a5
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Wed Dec 18 12:09:56 2013 +0000
Don't forget to handle OIS_ERROR
Hit by: scoof
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 79090fd..65c25d5 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -170,16 +170,24 @@ v1d_WriteDirObj(struct req *req)
oi = ObjIterBegin(req->wrk, req->obj);
XXXAN(oi);
- while (1) {
+ do {
ois = ObjIter(oi, &ptr, &len);
- if (ois == OIS_DONE) {
+ switch(ois) {
+ case OIS_DONE:
AZ(len);
break;
- }
- if (VDP_bytes(req,
- ois == OIS_DATA ? VDP_NULL : VDP_FLUSH, ptr, len))
+ case OIS_ERROR:
break;
- }
+ case OIS_DATA:
+ case OIS_STREAM:
+ if (VDP_bytes(req,
+ ois == OIS_DATA ? VDP_NULL : VDP_FLUSH, ptr, len))
+ ois = OIS_ERROR;
+ break;
+ default:
+ WRONG("Wrong OIS value");
+ }
+ } while (ois == OIS_DATA || ois == OIS_STREAM);
(void)VDP_bytes(req, VDP_FINISH, NULL, 0);
ObjIterEnd(&oi);
}
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic