Did the function HTXML_write forget to write stream to the "target" stream?
"wei wei" <[email protected]> Fri, 27 Jul 2007 11:24:43 -0700
| Newsgroups | gmane.comp.lib.libwww |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_7311_7499127.1185560683276 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I'm new to libwww, and have a question about downloading XML with it. I set up the example program, when I used it to download HTML pages and images, it worked well. But when I switch to XML, it failed to write the file to harddisk. According to the log, the program had got the content of the XML, but didn't write it down. I traced the program and finally focused to the function HTXML_write(HTStream *me, const char *buf, in len) in HTXML.c I think this function should write the content to the target stream in the param HTStream "me", after doing the XML_Parse work, just like what it did in function HTXML_abort. I added a line of code (*me->target->isa->put_block)(me->target,buf,len); before the return of HTXML_write. Then it worked here. Is this a bug? Or the fault of my programming? Wish someone can help me. Thank you -- Wei Wei ------=_Part_7311_7499127.1185560683276 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I'm new to libwww, and have a question about downloading XML with it.<br>I set up the example program, when I used it to download HTML pages and images, it worked well. But when I switch to XML, it failed to write the file to harddisk. According to the log, the program had got the content of the XML, but didn't write it down. <br>I traced the program and finally focused to the function <span style="font-style: italic;">HTXML_write(HTStream *me, const char *buf, in len)</span> in <span style="font-style: italic;">HTXML.c<br></span>I think this function should write the content to the target stream in the param HTStream "me", after doing the XML_Parse work, just like what it did in function <span style="font-style: italic;">HTXML_abort.<br></span>I added a line of code<br> <span style="font-style: italic;">(*me->target->isa->put_block)(me->target,buf,len);<br></span>before the return of <span style="font-style: italic;"> HTXML_write. </span>Then it worked here.<br>Is this a bug? Or the fault of my programming? Wish someone can help me. Thank you<br><span style="font-style: italic;"></span><br>-- <br>Wei Wei ------=_Part_7311_7499127.1185560683276--