As described in the Help forum by alacouture, calling
getField on a PR with a large attachment (1.5 MB) takes
a long time (2 minutes at 100% CPU utilization).
Actually, the problem seems to be in the PR setFromStringMethod.
Specifically this:
#get rid of trailing cr/lf
if ($val =~ /(.*)\015\012$/ms) {
$val = ;
}
this confuses me the '/ms' options are:
m=treat string as multiple line
s=treat string as single line
I don't understand why both are specified?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a case where while looping over multiple PRs of a
list, a small list of two PRs would work fine, but a larger
list would stop on the same PR (as in the smaller list)
while trying to execute
if ($val =~ /(.*)\015\012$/ms) {
in SetFromString. I don't know why the same PR works in a
small list and does not work in a big list. I only found
this issue after applying my own fix, which was to make the
code be like this:
if ($field ne 'Unformatted') {
if ($val =~ /(.*)\015\012$/ms) {
$val = $1;
}
}
I did this because my site doesn't use the unformatted field
for anything other than attachments, and I don't want cr/lf
stripped from attachments, especially since some are binary,
as was the case that caused me a problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=568459
Actually, the problem seems to be in the PR setFromStringMethod.
Specifically this:
#get rid of trailing cr/lf
if ($val =~ /(.*)\015\012$/ms) {
$val = ;
}
this confuses me the '/ms' options are:
m=treat string as multiple line
s=treat string as single line
I don't understand why both are specified?
Logged In: YES
user_id=568459
I think changing the above 3 lines to:
$val =~ s/\015\012$//;
has the same affect?
But I'm not sure how to test it.
Logged In: YES
user_id=1016120
I had a case where while looping over multiple PRs of a
list, a small list of two PRs would work fine, but a larger
list would stop on the same PR (as in the smaller list)
while trying to execute
if ($val =~ /(.*)\015\012$/ms) {
in SetFromString. I don't know why the same PR works in a
small list and does not work in a big list. I only found
this issue after applying my own fix, which was to make the
code be like this:
if ($field ne 'Unformatted') {
if ($val =~ /(.*)\015\012$/ms) {
$val = $1;
}
}
I did this because my site doesn't use the unformatted field
for anything other than attachments, and I don't want cr/lf
stripped from attachments, especially since some are binary,
as was the case that caused me a problem.