stas 2004/05/16 02:19:40
Modified: xs/APR/PerlIO apr_perlio.c src/modules/perl modperl_io_apache.c Log: use the MP_TRACE_STR_TRUNC macro to handle buffers of arbitrary length and filling Revision Changes Path 1.39 +4 -10 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -u -r1.38 -r1.39 --- apr_perlio.c 4 May 2004 06:19:12 -0000 1.38 +++ apr_perlio.c 16 May 2004 09:19:40 -0000 1.39 @@ -182,15 +182,8 @@ rc = apr_file_read(st->file, vbuf, &count); -#ifdef MP_TRACE - { - char *trace_buf = (char *)apr_pcalloc(st->pool, - sizeof(char*)*count); - memcpy((void*)trace_buf, vbuf, count); - trace_buf[count] = '\0'; - MP_TRACE_o(MP_FUNC, "count %d, [%s]", (int)count, (char*) trace_buf); - } -#endif + MP_TRACE_o(MP_FUNC, "%db [%s]\n", (int)count, + MP_TRACE_STR_TRUNC(st->pool, (char *)vbuf, (int)count)); if (rc == APR_EOF) { PerlIOBase(f)->flags |= PERLIO_F_EOF; @@ -209,7 +202,8 @@ PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR); apr_status_t rc; - MP_TRACE_o(MP_FUNC, "count %d, [%s]", (int)count, (char*) vbuf); + MP_TRACE_o(MP_FUNC, "%db [%s]\n", (int)count, + MP_TRACE_STR_TRUNC(st->pool, (char *)vbuf, (int)count)); rc = apr_file_write(st->file, vbuf, &count); if (rc == APR_SUCCESS) { 1.20 +1 -3 modperl-2.0/src/modules/perl/modperl_io_apache.c Index: modperl_io_apache.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -u -r1.19 -r1.20 --- modperl_io_apache.c 13 May 2004 01:28:39 -0000 1.19 +++ modperl_io_apache.c 16 May 2004 09:19:40 -0000 1.20 @@ -175,9 +175,7 @@ MP_TRACE_o(MP_FUNC, "%4db [%s]", rcfg->wbucket->outcnt, MP_TRACE_STR_TRUNC(rcfg->wbucket->pool, - apr_pstrmemdup(rcfg->wbucket->pool, - rcfg->wbucket->outbuf, - rcfg->wbucket->outcnt), + rcfg->wbucket->outbuf, rcfg->wbucket->outcnt)); MP_FAILURE_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE));