On Wed, 1 Jun 2022 at 15:34, <cove...@apache.org> wrote: > > Author: covener > Date: Wed Jun 1 12:33:53 2022 > New Revision: 1901500 > > URL: http://svn.apache.org/viewvc?rev=1901500&view=rev > Log: > handle large writes in ap_rputs > > Modified: > httpd/httpd/trunk/include/http_protocol.h > httpd/httpd/trunk/server/protocol.c > > Modified: httpd/httpd/trunk/include/http_protocol.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_protocol.h?rev=1901500&r1=1901499&r2=1901500&view=diff > ============================================================================== > --- httpd/httpd/trunk/include/http_protocol.h (original) > +++ httpd/httpd/trunk/include/http_protocol.h Wed Jun 1 12:33:53 2022 > @@ -501,7 +501,27 @@ AP_DECLARE(int) ap_rwrite(const void *bu > */ > static APR_INLINE int ap_rputs(const char *str, request_rec *r) > { > - return ap_rwrite(str, (int)strlen(str), r); > + apr_size_t len; > + > + len = strlen(str); > + > + for (;;) { > + if (len <= INT_MAX) { > + return ap_rwrite(str, (int)len, r); > + } > + else { > + int rc; > + > + rc = ap_rwrite(str, INT_MAX, r); > + if (rc < 0) { > + return rc; > + } > + else { > + str += INT_MAX; > + len -= INT_MAX; > + } > + } > + } After this change apr_rputs() doesn't return value.
-- Ivan Zhakov