Re: [gmime-devel] GMimeFilterHTML: ignoring URL at the end of part?



Excerpts from Jeffrey Stedfast's message of April 10, 2015 16:06:
Hi Gaute,

Just to rule out gmime_iostream.cc, can you write a simple program to
do this?

char buffer[4096]; ssize_t n;

while ((n = g_mime_stream_read (filtered_stream, buffer, 4096) > 0)
write (1, buffer, n);

This does work as it should! Thanks a lot, I'll just drop
gmime_iostream.cc.


(in this case filtered_stream is your HTML filtered stream, set up the same way you are setting it up in chunk.cc)

It sounds to me like you are saying that priv->filtered has the data at line 231 in gmime-stream-filter.c? If so, then a subsequent call to g_mime_stream_read() should scoop up the remaining filtered data. If another call is not being made to g_mime_stream_read(), then it sounds like a bug in gmime_iostream.cc.

Presumably at some point, g_mime_stream_read() is reading 0 bytes from the source stream, and so the "if (nread <= 0) ..." code-path is taken (line 191). At this point, the g_mime_stream_eos() check on the source stream should return true, and priv->flushed should be false, so it should go into that code-path and loop over all of the filters calling the complete() method on them. At the end of that loop, priv->filteredlen should have a value > 0 which means that the "if <nread <= 0) return nread" check should fail, allowing the code to fall through to the end of the function which will copy data from priv->filtereddata into your buffer.

Hope that helps explain how things *should* work... whether they do or not, I can't tell, because I can't get gmime to build on my Mac yet :-(

Arch Linux works great on this Macbook Pro ;)

- gaute



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]