httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: weird stuff in http_main.c
Date Mon, 16 Dec 1996 17:39:17 GMT

This is one of those problems that floated by this past week
that I have not looked into. Could someone explain "Why?" the
assert() calls?


> 	What's the deal with these asserts in http_main.c? They seem
> to be asserting something which isn't always going to be true. Here's
> a patch. on HP/UX 9 the second assert fails, and the server doesn't
> start.
> 
> 	I don't know this bit of code though at all, is this patch
> right?
> 
> Index: http_main.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_main.c,v
> retrieving revision 1.96
> diff -c -r1.96 http_main.c
> *** http_main.c 1996/12/15 15:09:34     1.96
> --- http_main.c 1996/12/16 09:07:40
> ***************
> *** 1743,1752 ****
>       {
>       listen_rec *lr;
>   
> -     assert(old_listeners == NULL);
>       for(lr=listeners ; lr ; lr=lr->next)
>         {
> !       listen_rec *nr=malloc(sizeof *nr);
>         if (nr == NULL) {
>           fprintf (stderr, "Ouch!  malloc failed in copy_listeners()\n");
>           exit (1);
> --- 1743,1751 ----
>       {
>       listen_rec *lr;
>   
>       for(lr=listeners ; lr ; lr=lr->next)
>         {
> !       listen_rec *nr=calloc(sizeof *nr, (size_t) 1);
>         if (nr == NULL) {
>           fprintf (stderr, "Ouch!  malloc failed in copy_listeners()\n");
>           exit (1);
> ***************
> *** 1754,1760 ****
>         *nr=*lr;
>         kill_cleanups_for_fd(p,nr->fd);
>         nr->next=old_listeners;
> -       assert(!nr->used);
>         old_listeners=nr;
>         }
>       }
> --- 1753,1758 ----
> 
> 
> -- 
> Sameer Parekh					Voice:   510-986-8770
> President					FAX:     510-986-8777
> C2Net
> http://www.c2.net/				sameer@c2.net




Mime
View raw message