You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Shane Pope <im...@gmail.com> on 2009/11/04 05:01:40 UTC

Re: Recv'ing data directly from a socket and running it through SSL input filter.

Essentially what I'm asking is,
I have data in a char *
I have the filters (r->input_filters) I need to run this through.
Is there a way to send this data through that filter?

I've found some code that will let me place that data in a bucket brigade.

	apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
	apr_bucket *b = apr_bucket_transient_create(str, len, c->bucket_alloc);
	APR_BRIGADE_INSERT_TAIL(bb, b);

But then what?

Thank you,
Shane

On Tue, Nov 3, 2009 at 12:29 AM, Shane Pope <im...@gmail.com> wrote:
>
> Hello modules-dev mailing list,
> I'm attempting to write a module that proxy's bits from an outside host to a local port under SSL. I have everything working except reading data from the client socket, and sending it through the SSL filter to decrypt it.
>
> For outputting bits to the client connection I can get the data from the local socket like this
>
> rv = apr_socket_recv(local_socket, buffer, &nbytes);
>
> and call these two functions, which would pass the bits through the output filters.
>
> ap_rwrite(buffer, nbytes, r);
> ap_rflush(r);
>
> But I cannot read bits directly from the client socket, because it's encrypted. I've attempted to pass the bits through input_filters but failed.
>
> rv = apr_socket_recv(client_socket, buffer, &nbytes);
> //tried passing bits through filters, but don't know what I'm doing wrong. what next?
>
> Thanks,
> Shane

Re: Recv'ing data directly from a socket and running it through SSL input filter.

Posted by Shane Pope <im...@gmail.com>.
This has been solved by creating a new input filter, replacing core
with it, and calling ap_get_brigade on my new input_filter chain.
Apologies for so many messages,
Shane