You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ilya gordon <gr...@iggroup.org> on 2004/07/02 23:19:25 UTC

[users@httpd] Apache 2.0 Buffered I/O API question

I am converting a custom module that is written in C for Apache 1.3. Due
to the  lack of documentation for the Apache 2.0 API
I am forced to pull my hair out. :)
I came across a set of functions in the Apache 1.3 API but I can't find
them or their equivalent in the new 2.0 APIs :

http://www.hk8.org/old%5Fweb/linux/....htm#INDEX-1512

for example

    14.6.22. Buffering Functions
    Apache provides its own I/O buffering interface. This allows
chunked transfers to be done transparently and hides differences
between files and sockets under Win32.

    ap_bcreate create a buffered stream

    BUFF *ap_bcreate(pool *p, int flags)
    Creates a new buffered stream in p. The stream is not associated
with any file or socket at this point. flags are a combination of one of
the following:


These set of functions is completely missing from the new Apache 2.0 API.
Does anybody know what they are replaced with.

Thanks in advance.




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.0 Buffered I/O API question

Posted by ilya gordon <gr...@iggroup.org>.
i have looked at apr_network_io.h.

i don't see anything that offers the same ability as the
ap_bcrete() or ap_pushfd() did.

Does this mean i have to write to the socket using apr_socket_send()?
this is much less convinient then the old way.
do you know any other alternatives?

Thanks
-- 
ilya


Nick Kew said:
> On Tue, 6 Jul 2004, ilya gordon wrote:
>
>> This is what I have right now in a module for ver 1.3 that I am trying
>> to
>> convert to 2.0 API
>>
>>   buffer = ap_bcreate( r->pool, B_RDWR );
>>   ap_bpushfd( buffer, socket, socket );
>
> Oh, you mean IPC unconnected with the request/response?
>
> That's now APR, not HTTPD.  Look at apr_network_io.h.
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.0 Buffered I/O API question

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 6 Jul 2004, ilya gordon wrote:

> This is what I have right now in a module for ver 1.3 that I am trying to
> convert to 2.0 API
>
>   buffer = ap_bcreate( r->pool, B_RDWR );
>   ap_bpushfd( buffer, socket, socket );

Oh, you mean IPC unconnected with the request/response?

That's now APR, not HTTPD.  Look at apr_network_io.h.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache 2.0 Buffered I/O API question

Posted by ilya gordon <gr...@iggroup.org>.
Nick Kew <nick <at> webthing.com> writes:

> 
> On Fri, 2 Jul 2004, ilya gordon wrote:
> 
> > These set of functions is completely missing from the new Apache 2.0 API.
> > Does anybody know what they are replaced with.
> 
> Not unless you tell us what you need that isn't provided for by the
> ap_rwrite() and/or ap_fwrite() family of buffered IO functions.
> 


This is what I have right now in a module for ver 1.3 that I am trying to 
convert to 2.0 API

  buffer = ap_bcreate( r->pool, B_RDWR );
  ap_bpushfd( buffer, socket, socket );

>From what I understand this creates a i/o buffer in the pool with READ and 
WRITE permissions. Then with ap_bpushfd it connects the buffer to the 
read/write streams of the socket. 

To print to the socket I do something like
  
  ap_bprintf( buffer, "Hello %s!\r\n", name);

Since ap_bcreate() is missing from 2.0 API, how would I convert this properly 
to the new 2.0 API.

Thanks


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.0 Buffered I/O API question

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 2 Jul 2004, ilya gordon wrote:

> These set of functions is completely missing from the new Apache 2.0 API.
> Does anybody know what they are replaced with.

Not unless you tell us what you need that isn't provided for by the
ap_rwrite() and/or ap_fwrite() family of buffered IO functions.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org