Mailing List Archive

A couple of patches
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Attached are two patches that I have been sitting on for several months now.
Sorry about that.

The first modifies byLogWindow to return 1 instead of 0 when there's
only 1 server in the list. The current behavior is technically correct, but
practically incorrect: I would rather use the last server on the list than
eliminate it just because log2(1) == 0. (I realize that using byLogWindow
for a small number of servers will tend to do that, but that's not the point)

The second patch just adds some error logging so I can see what's going on.

I have been using mod_backhand (with these patches) to frontend 3 web servers for 7+
months and it is working quite well. Very nice work!

-Gyepi Sam

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mod_backhand.patch1"

--- builtins.c.orig Fri Jun 29 17:12:48 2001
+++ builtins.c Fri Jun 29 17:12:05 2001
@@ -188,6 +188,7 @@
int mycount=0, oldsize=*n;
while(oldsize >>= 1) mycount++;
/* new size is now floor(log2(*n)) */
+ if (mycount == 0) mycount = *n;
*n = mycount;
return mycount;
}

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mod_backhand.patch2"

--- apue.c.orig Fri Jun 29 17:30:55 2001
+++ apue.c Fri Jun 29 17:33:27 2001
@@ -322,8 +322,10 @@
char oldfile[MAXPATHLEN];

/* create a Unix domain stream socket */
- if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
+ if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0){
+ perror("cli_conn -- create socket");
return(-1);
+ }
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
if(from)
@@ -348,6 +350,9 @@
}
return(fd);
error:
+ if (errno)
+ perror("cli_conn");
+
unlink(oldfile);
close(fd);
fd=-1;

--NzB8fVQJ5HfG6fxh--