You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Mark J Cox <M....@bradford.ac.uk> on 1995/11/02 10:04:34 UTC

0.8.15 mod_imap problem

I changed over to using the imap module for all our imagemaps yesterday.
This morning I was greeted by over 1,000 email messages from my server
each with a "500" error.  It turns out that a request for
something.imap?somearg,somearg works fine; but a request for 
something.imap with no arguments gives a server error.  Unfortunately
a lot of clients that cannot support imagemaps don't send arguments.

Even though mod_imap is not a default module, I think it needs fixing
before 1.0.   Heres a patch

Mark J Cox,  mark@telescope.org -- URL:http://www.telescope.org/mark.html
University of Bradford, England ---------- tel +44.1274.384070/fax 391333

From: Mark Cox <ma...@awe.com>
Subject: Mod_Imap causes server error if no arguments
Requires:
Affects: mod_imap.c
Changelog:
Internal imagemap module no longer fails when called by clients that don't
support image maps.  It uses the "default" URL for these clients.

*** mod_imap.c.orig     Wed Oct 11 23:17:49 1995
--- mod_imap.c  Thu Nov  2 08:52:01 1995
***************
*** 272,287 ****
      double dist, mindist;
      int sawpoint = 0;
  
! 
!     if (r->args == NULL)
!       return SERVER_ERROR;
! 
!     if (!(ycoord = strchr (r->args, ',')))
!       return BAD_REQUEST;
! 
!     *ycoord++ = '\0';
!     testpoint[X] = (double) atoi (r->args);
!     testpoint[Y] = (double) atoi (ycoord);
      
      if (!(imap = fopen (r->filename,"r")))
          return SERVER_ERROR;
--- 272,287 ----
      double dist, mindist;
      int sawpoint = 0;
  
!     if (r->args == NULL) { /* Client doesn't support Imagemaps, */
!       testpoint[X] = -1;   /* so fake some co-ordinates so that */
!       testpoint[Y] = -1;   /* the default is picked.  MJC 02Nov95 */
!     } else {
!         if (!(ycoord = strchr (r->args, ',')))
!           return BAD_REQUEST;
!         *ycoord++ = '\0';
!         testpoint[X] = (double) atoi (r->args);
!         testpoint[Y] = (double) atoi (ycoord);
!     }
      
      if (!(imap = fopen (r->filename,"r")))
          return SERVER_ERROR;


Re: 0.8.15 mod_imap problem

Posted by Brian Behlendorf <br...@organic.com>.
+1.  Though eventually I'd like to see it return a menu of available 
options.

	Brian

On Thu, 2 Nov 1995, Mark J Cox wrote:
> From: Mark Cox <ma...@awe.com>
> Subject: Mod_Imap causes server error if no arguments
> Requires:
> Affects: mod_imap.c
> Changelog:
> Internal imagemap module no longer fails when called by clients that don't
> support image maps.  It uses the "default" URL for these clients.
> 
> *** mod_imap.c.orig     Wed Oct 11 23:17:49 1995
> --- mod_imap.c  Thu Nov  2 08:52:01 1995
> ***************
> *** 272,287 ****
>       double dist, mindist;
>       int sawpoint = 0;
>   
> ! 
> !     if (r->args == NULL)
> !       return SERVER_ERROR;
> ! 
> !     if (!(ycoord = strchr (r->args, ',')))
> !       return BAD_REQUEST;
> ! 
> !     *ycoord++ = '\0';
> !     testpoint[X] = (double) atoi (r->args);
> !     testpoint[Y] = (double) atoi (ycoord);
>       
>       if (!(imap = fopen (r->filename,"r")))
>           return SERVER_ERROR;
> --- 272,287 ----
>       double dist, mindist;
>       int sawpoint = 0;
>   
> !     if (r->args == NULL) { /* Client doesn't support Imagemaps, */
> !       testpoint[X] = -1;   /* so fake some co-ordinates so that */
> !       testpoint[Y] = -1;   /* the default is picked.  MJC 02Nov95 */
> !     } else {
> !         if (!(ycoord = strchr (r->args, ',')))
> !           return BAD_REQUEST;
> !         *ycoord++ = '\0';
> !         testpoint[X] = (double) atoi (r->args);
> !         testpoint[Y] = (double) atoi (ycoord);
> !     }
>       
>       if (!(imap = fopen (r->filename,"r")))
>           return SERVER_ERROR;
> 
> 
> 

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  brian@hyperreal.com  http://www.[hyperreal,organic].com/