I wrote some time ago:
I worte some time ago:
I tried to compile mod_webkit2 with apache-2.0.52 and got an error (mod_webkit.c:244: error: too few arguments to function `apr_socket_create'). I use gcc-3.3.5 (although I think, it doesn't meter in this case). Could you help me with that? Does the Apache API get change since 2.0.52 (I used to use mod_webkit2 with any problems some times ago till I upgrade apache).
OK. It was problem in apr-1.0.0 not in Apache. It seems like they don't like APR_BRIGADE_FOREACH macro any more. And there is an extra argument in apr_socket_create function to specify protocol of the socket. It can have one of value: APR_PROTO_TCP, APR_PROTO_UDP or APR_PROTO_SCTP. Which one should be used in mod_webkit2 ??
I attach a patch for file mod_webkit.c. I use APR_PROTO_TCP value for that extra argument. The module builds now but I have not tested it yet.
See: http://apr.apache.org/docs/apr-util/group__APR__Util__Bucket__Brigades.html#a80
and http://apr.apache.org/docs/apr/group__apr__network__io.html#ga6
Well. I did tests and I found out that there are no more apr_send and apr_connect functions in apr-1.0.0. We should use apr_socket_send and apr_socket_connect instead. I atach new version of my patch.
Cheers, Radek
PS. CC: webware-devel as it is right place
-- Radosław Kintzi Lucas Consulting [EMAIL PROTECTED]
--- mod_webkit.c.orig 2004-12-30 12:04:02.913241056 +0100 +++ mod_webkit.c 2004-12-30 12:09:12.853123032 +0100 @@ -241,7 +241,9 @@ return NULL; } if ((rv = apr_socket_create(&aprsock, AF_INET, - SOCK_STREAM, r->pool)) != APR_SUCCESS) + SOCK_STREAM, + APR_PROTO_TCP, + r->pool)) != APR_SUCCESS) { log_error("Failure creating socket for appserver connection",r->server); @@ -251,7 +253,7 @@ /* Tries to connect to appserver (continues trying while error is EINTR) */ do { - rv = apr_connect(aprsock, cfg->apraddr); + rv = apr_socket_connect(aprsock, cfg->apraddr); // ret=connect(sock,(struct sockaddr *)&addr,sizeof(struct sockaddr_in)); #ifdef WIN32 // if (rv==SOCKET_ERROR) errno=WSAGetLastError()-WSABASEERR; @@ -287,7 +289,9 @@ const char *buf; apr_size_t len; apr_status_t rv; - APR_BRIGADE_FOREACH(e, bb) { + for (e = APR_BRIGADE_FIRST(bb); + e != APR_BRIGADE_SENTINEL(bb); + e = APR_BUCKET_NEXT(e)) { if (APR_BUCKET_IS_EOS(e)) { break; } @@ -339,9 +343,9 @@ // twice. aprlen = int_dict->ptr - int_dict->str; - rv = apr_send(aprsock, int_dict->str, &aprlen); + rv = apr_socket_send(aprsock, int_dict->str, &aprlen); aprlen = length; - rv = apr_send(aprsock,whole_dict->str,&aprlen); + rv = apr_socket_send(aprsock,whole_dict->str,&aprlen); //This is copied from mod_cgi @@ -366,7 +370,9 @@ return rv; } - APR_BRIGADE_FOREACH(bucket, bb) { + for (bucket = APR_BRIGADE_FIRST(bb); + bucket != APR_BRIGADE_SENTINEL(bb); + bucket = APR_BUCKET_NEXT(bucket)) { const char *data; apr_size_t len; @@ -390,7 +396,7 @@ do { aprlen=len; - rv = apr_send(aprsock, data, &aprlen); + rv = apr_socket_send(aprsock, data, &aprlen); len = len-aprlen; data += aprlen; } while (len >0 && rv==APR_SUCCESS);