You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@lnd.com> on 2000/02/08 03:08:05 UTC
Re: Apache Mod_Proxy SSL Bug (win32) (Bugnr 4885) - SOLVED!
Forwarded on behalf of Boris from
comp.infosystems.www.servers.ms-windows
---------------------------------------
"Boris Klug" <bo...@klg.de> wrote in message
news:<38...@klg.de>...
Hi!
find attached a small patch for Apache 1.3.6 which solves the mod_proxy
SSL problem under Win32. See bugreport number 4885 for more details.
This patcht replaces the read/write functions in the https part of
mod_proxy with their send/recv counterpart and - voila la - it works.
Its more a quick hack. As stated in the comment in proxy_connect, the
Apache
socket functions should be used. Also error checking is not implemented.
Because I dont know how to send this patch to apache.org, I post it
here. Hope it will be included in future versions of Apache.
====================== schnipp - schnipp =============================
*** apache_1.3.6/src/modules/proxy/proxy_connect.c Sun Feb 7
21:48:31 1999
--- proxy_connect.c Fri Feb 4 10:20:37 2000
***************
*** 226,235 ****
--- 226,247 ----
Explain0("Sending the CONNECT request to the remote proxy");
ap_snprintf(buffer, sizeof(buffer), "CONNECT %s HTTP/1.0" CRLF,
r->uri);
+
+ #ifndef WIN32
write(sock, buffer, strlen(buffer));
+ #else
+ send(sock, buffer, strlen(buffer),0);
+ #endif
+
ap_snprintf(buffer, sizeof(buffer),
"Proxy-agent: %s" CRLF CRLF,
ap_get_server_version());
+
+ #ifndef WIN32
write(sock, buffer, strlen(buffer));
+ #else
+ send(sock, buffer, strlen(buffer),0);
+ #endif
+
}
else {
Explain0("Returning 200 OK Status");
***************
*** 252,261 ****
--- 264,282 ----
if (i) {
if (FD_ISSET(sock, &fds)) {
Explain0("sock was set");
+
+ #ifndef WIN32
if ((nbytes = read(sock, buffer, HUGE_STRING_LEN)) != 0)
{
+ #else
+ if ((nbytes = recv(sock, buffer, HUGE_STRING_LEN,0)) !=
0) {
+ #endif
if (nbytes == -1)
break;
+ #ifndef WIN32
if (write(r->connection->client->fd, buffer, nbytes)
== EOF)
+ #else
+ if (send(r->connection->client->fd, buffer,
nbytes,0) == EOF)
+ #endif
break;
Explain1("Wrote %d bytes to client", nbytes);
}
***************
*** 264,274 ****
--- 285,306 ----
}
else if (FD_ISSET(r->connection->client->fd, &fds)) {
Explain0("client->fd was set");
+
+ #ifndef WIN32
if ((nbytes = read(r->connection->client->fd, buffer,
HUGE_STRING_LEN)) != 0) {
+ #else
+ if ((nbytes = recv(r->connection->client->fd, buffer,
+ HUGE_STRING_LEN,0)) != 0) {
+ #endif
if (nbytes == -1)
break;
+
+ #ifndef WIN32
if (write(sock, buffer, nbytes) == EOF)
+ #else
+ if (send(sock, buffer, nbytes,0) == EOF)
+ #endif
break;
Explain1("Wrote %d bytes to server", nbytes);
}
--
Boris Klug mailto:boris@klg.de
http://www.klg.de/
Ask T-shirts, not
ties!