christophebedard/rmw_email

Email size is limited?

christophebedard opened this issue · 2 comments

By size * nitems bytes: https://curl.se/libcurl/c/CURLOPT_READFUNCTION.html

which seems to be 2^16 = 65536. This can be seen by running performance_test with Array256k, for example. An error should be printed: "truncated to len ..."

There might be a way to increase this limit.

Wait. It might not be a bug. Re-reading the code and the curl docs:

The data area pointed at by the pointer buffer should be filled up with at most size multiplied with nitems number of bytes by your function.

Your function must return the actual number of bytes that it stored in the data area pointed at by the pointer buffer. Returning 0 will signal end-of-file to the library and cause it to stop the current transfer.

so the callback is called multiple times, each time reading at most X bytes. The logger()->error() call should therefore be downgraded to a debug() call after confirming that a big transfer like that actually works.

Yep, works fine with Array256k. Gmail won't even display the full content of the emails.