| 569 | } |
| 570 | |
| 571 | static int imap_handler_internal(request_rec *r) |
| 572 | { |
| 573 | char input[MAX_STRING_LEN]; |
| 574 | char *directive; |
| 575 | char *value; |
| 576 | char *href_text; |
| 577 | const char *base; |
| 578 | const char *redirect; |
| 579 | const char *mapdflt; |
| 580 | char *closest = NULL; |
| 581 | double closest_yet = -1; |
| 582 | apr_status_t status; |
| 583 | |
| 584 | double testpoint[2]; |
| 585 | double pointarray[MAXVERTS + 1][2]; |
| 586 | int vertex; |
| 587 | |
| 588 | char *string_pos; |
| 589 | int showmenu = 0; |
| 590 | |
| 591 | imap_conf_rec *icr; |
| 592 | |
| 593 | char *imap_menu; |
| 594 | char *imap_default; |
| 595 | char *imap_base; |
| 596 | |
| 597 | ap_configfile_t *imap; |
| 598 | |
| 599 | icr = ap_get_module_config(r->per_dir_config, &imagemap_module); |
| 600 | |
| 601 | imap_menu = icr->imap_menu ? icr->imap_menu : IMAP_MENU_DEFAULT; |
| 602 | imap_default = icr->imap_default |
| 603 | ? icr->imap_default : IMAP_DEFAULT_DEFAULT; |
| 604 | imap_base = icr->imap_base ? icr->imap_base : IMAP_BASE_DEFAULT; |
| 605 | |
| 606 | status = ap_pcfg_openfile(&imap, r->pool, r->filename); |
| 607 | |
| 608 | if (status != APR_SUCCESS) { |
| 609 | return HTTP_NOT_FOUND; |
| 610 | } |
| 611 | |
| 612 | base = imap_url(r, NULL, imap_base); /* set base according |
| 613 | to default */ |
| 614 | if (!base) { |
| 615 | return HTTP_INTERNAL_SERVER_ERROR; |
| 616 | } |
| 617 | mapdflt = imap_url(r, NULL, imap_default); /* and default to |
| 618 | global default */ |
| 619 | if (!mapdflt) { |
| 620 | return HTTP_INTERNAL_SERVER_ERROR; |
| 621 | } |
| 622 | |
| 623 | testpoint[X] = get_x_coord(r->args); |
| 624 | testpoint[Y] = get_y_coord(r->args); |
| 625 | |
| 626 | if ((testpoint[X] == -1 || testpoint[Y] == -1) || |
| 627 | (testpoint[X] == 0 && testpoint[Y] == 0)) { |
| 628 | /* if either is -1 or if both are zero (new Lynx) */ |
no test coverage detected