*** mod_pyapache.c.orig Mon Feb 28 20:51:48 2005 --- mod_pyapache.c Mon Feb 28 20:55:18 2005 *************** *** 996,1006 **** --- 996,1029 ---- if (size) { + #ifdef RUSSIAN_APACHE + unsigned char *newbuf,*p; + int newlen=0; + #endif Py_BEGIN_ALLOW_THREADS #ifndef PyApache_APACHE2 put = ap_bwrite (self->r->connection->client, str, size); #else + #ifdef RUSSIAN_APACHE + if (ra_charset_active(self->r)) + { + ra_data_server2client(self->r, str, size, &newbuf, &newlen); + p=newbuf; + while(newlen > 0) + { + put = ap_bwrite(self->r->connection->client, p, newlen); + if(put<=0) goto RECODE_DONE; + newlen-=put; + p+=put; + } + put = size; + } + else + put = ap_bwrite (self->r->connection->client, str, size); + RECODE_DONE:; + #else put = ap_rwrite (str, size, self->r); + #endif #endif Py_END_ALLOW_THREADS