Commit feafbe25 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Handle the case where we already have a full buffer on entry.

parent 2e3b5a5d
......@@ -367,12 +367,16 @@ VGZ_WrwGunzip(struct sess *sp, struct vgz *vg, void *ibuf, ssize_t ibufl,
VGZ_Ibuf(vg, ibuf, ibufl);
VGZ_Obuf(vg, obuf + *obufp, ibufl - *obufp);
do {
i = VGZ_Gunzip(vg, &dp, &dl);
if (obufl == *obufp)
i = VGZ_STUCK;
else {
i = VGZ_Gunzip(vg, &dp, &dl);
*obufp += dl;
}
if (i < VGZ_OK) {
/* XXX: VSL ? */
return (-1);
}
*obufp += dl;
if (obufl == *obufp || i == VGZ_STUCK) {
WRW_Write(sp->wrk, obuf, *obufp);
if (WRW_Flush(sp->wrk))
......
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