Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 37332 invoked from network); 30 Jan 2009 11:50:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2009 11:50:49 -0000 Received: (qmail 29294 invoked by uid 500); 30 Jan 2009 11:50:43 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29224 invoked by uid 500); 30 Jan 2009 11:50:42 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 29215 invoked by uid 99); 30 Jan 2009 11:50:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jan 2009 03:50:42 -0800 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [194.138.12.131] (HELO mxs1.siemens.at) (194.138.12.131) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jan 2009 11:50:32 +0000 Received: from vies1k7x.sie.siemens.at ([158.226.129.83]) by mxs1.siemens.at with ESMTP id n0UBoAOK015366 for ; Fri, 30 Jan 2009 12:50:10 +0100 Received: from nets138a.ww300.siemens.net ([192.168.217.3]) by vies1k7x.sie.siemens.at (8.12.11.20060308/8.12.1) with ESMTP id n0UBoAVA006377 for ; Fri, 30 Jan 2009 12:50:10 +0100 Received: from prga004a.ww300.siemens.net ([163.242.71.105]) by nets138a.ww300.siemens.net with Microsoft SMTPSVC(6.0.3790.3959); Fri, 30 Jan 2009 12:50:10 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Subject: RE: Sending data to client Date: Fri, 30 Jan 2009 12:50:09 +0100 Message-ID: <3E4278088AD82C48B4663DDFE762CEF305DCD41A@prga004a.ww300.siemens.net> In-Reply-To: <4982E463.5030602@sharp.fm> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Sending data to client Thread-Index: AcmCzfwkx9uoPvrdTq2PcVdtgOmA/gAAinBA References: <3E4278088AD82C48B4663DDFE762CEF305DCD05A@prga004a.ww300.siemens.net> <4982E463.5030602@sharp.fm> From: "Hracek, Petr" To: X-OriginalArrivalTime: 30 Jan 2009 11:50:10.0030 (UTC) FILETIME=[E73098E0:01C982D0] X-purgate: clean X-purgate: This mail is considered clean X-purgate-type: clean X-purgate-Ad: Checked for Spam by eleven - eXpurgate www.eXpurgate.net X-purgate-ID: 149917::090130125010-0B9D0BA0-198410EB/0-0/0-15 X-purgate-size: 3064/0 X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the question about replacement of ap_*_timeout. When the ap_soft_timeout and ap_rwrite are called in Apache 1.3 I've never inserted HTML tags like etc. They were inserted automatically? Is it necessary to include HTML tags to buffer which is sent to the = Client side? And do you know how can I monitored if the date were successfully sent / = delivered to=20 the client side? All comunication is done over https. Thank you in advance regards / S pozdravem Petr Hr=E1=E8ek -----Original Message----- From: Graham Leggett [mailto:minfrin@sharp.fm]=20 Sent: Friday, January 30, 2009 12:29 PM To: dev@httpd.apache.org Subject: Re: Sending data to client Hracek, Petr wrote: > I am migrating apache module from version 1.3.41 to version 2.2.3 > All seems to be OK but only one thing remains as not working and I = have no idea how to solve > it in Apache 2.2. > =20 > In the version 1.3.41 I used to following code for sending data to = client: > ap_soft_timeout ("TEXT MESSAGE",r); > ap_rwrite(MESSAGE_TO_CLIENT, strlen(MESSAGE_TO_CLIENT),r); > ap_kill_timeout(r); > =20 > How can send data to client on Apache 2.2? Apache v2.0 (and v2.2) introduced the concept of an input and an output=20 filter stack to handle the problem of reading from and writing to the=20 network. The input filter stack is a chain of code that reads data in from the=20 network. Filters in the stack along the way might uncompress the data,=20 decrypt the data, or do any of a number of things to the data before=20 handing the data to you. The output filter stack is a chain of code that writes data to the=20 network, and is the one you want to care about. The output filter stack=20 might encrypt, compress, chunk or otherwise process the data you send,=20 and you don't need to know or care how this is done. The filter stacks solved a long standing problem in Apache 1.3, which if = you wanted to process data that was entering or leaving the server, you=20 couldn't really without hacking away at the core. So, to come round and actually answer your question, in Apache v2.2, you = want to write your data to the output filter stack. The best examples are in the webserver itself. The least confusing=20 module to use as an example would probably be the status_handler=20 function inside mod_status, which uses ap_rputs() and ap_rvputs() to=20 write strings to the network, which sounds like what you are doing. If you want to have more control over the data you are sending, you can=20 call ap_pass_brigade() to "write" some data, in the form of a bucket=20 bridge, to the network in your response. This second option allows you to send any number of things to the=20 network, from static areas of memory, to files on disk, in a very=20 efficient way. For more information about bucket brigades, read the docs = for the bucket brigade API in APR: http://apr.apache.org/docs/apr-util/trunk/group___a_p_r___util___bucket__= _brigades.html Regards, Graham --