summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-02-08 18:43:26 +0100
committerjcid <devnull@localhost>2008-02-08 18:43:26 +0100
commit2c43308b4688c7b296424262a25ce18050f7a482 (patch)
tree577391aa5341f00cbda8091878adda987b5bd706 /src
parentcde6c1b6649e1c32fbb0f6d04cb4f6f2b1cac99e (diff)
- added flush for bare images and plain text pages.
Diffstat (limited to 'src')
-rw-r--r--src/image.cc3
-rw-r--r--src/plain.cc7
2 files changed, 6 insertions, 4 deletions
diff --git a/src/image.cc b/src/image.cc
index 110d56b3..54eb4710 100644
--- a/src/image.cc
+++ b/src/image.cc
@@ -132,7 +132,8 @@ void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url,
{
_MSG("a_Image_set_parms: width=%d height=%d\n", width, height);
- OI(Image)->setBuffer((Imgbuf*)v_imgbuf);
+ bool resize = (Image->width != width || Image->height != height);
+ OI(Image)->setBuffer((Imgbuf*)v_imgbuf, resize);
if (!Image->BitVec)
Image->BitVec = a_Bitvec_new(height);
diff --git a/src/plain.cc b/src/plain.cc
index ea545f89..0c8a528e 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -155,6 +155,8 @@ void DilloPlain::write(void *Buf, uint_t BufSize, int Eof)
char *data;
uint_t i, len, MaxBytes;
+ _MSG("DilloPlain::write Eof=%d\n", Eof);
+
Start = (char*)Buf + Start_Ofs;
MaxBytes = BufSize - Start_Ofs;
i = len = 0;
@@ -188,7 +190,7 @@ void DilloPlain::write(void *Buf, uint_t BufSize, int Eof)
Start_Ofs += len;
}
- DW2TB(dw)->flush(false);
+ DW2TB(dw)->flush(Eof ? true : false);
if (bw)
a_UIcmd_set_page_prog(bw, Start_Ofs, 1);
@@ -223,8 +225,7 @@ static void Plain_callback(int Op, CacheClient_t *Client)
if (Op) {
/* Do the last line: */
- if (plain->Start_Ofs < Client->BufSize)
- plain->write(Client->Buf, Client->BufSize, 1);
+ plain->write(Client->Buf, Client->BufSize, 1);
/* remove this client from our active list */
a_Bw_close_client(plain->bw, Client->Key);
/* set progress bar insensitive */