Changeset 28
- Timestamp:
- 02/19/2005 09:38:12 PM (4 years ago)
- Files:
-
- 2 added
- 2 modified
-
src/mod_fastcgi.c (modified) (9 diffs)
-
tests/Makefile.am (modified) (2 diffs)
-
tests/fastcgi-13.conf (added)
-
tests/fastcgi-13.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
src/mod_fastcgi.c
r9 r28 639 639 socklen_t servlen; 640 640 641 const char *appPath;642 const char *hostname;643 unsigned short port;644 645 appPath = host->bin_path->ptr;646 647 hostname = host->host->ptr;648 port = proc->port;649 650 641 #ifndef HAVE_FORK 651 642 return -1; … … 654 645 if (p->conf.debug) { 655 646 log_error_write(srv, __FILE__, __LINE__, "sdb", 656 "new proc, socket:", p ort, proc->socket);647 "new proc, socket:", proc->port, proc->socket); 657 648 } 658 649 … … 689 680 690 681 691 if (NULL == (he = gethostbyname(host name))) {682 if (NULL == (he = gethostbyname(host->host->ptr))) { 692 683 log_error_write(srv, __FILE__, __LINE__, 693 "ss s", "gethostbyname failed: ",694 hstrerror(h_errno), host name);684 "ssb", "gethostbyname failed: ", 685 hstrerror(h_errno), host->host); 695 686 return -1; 696 687 } … … 709 700 710 701 } 711 fcgi_addr_in.sin_port = htons(p ort);702 fcgi_addr_in.sin_port = htons(proc->port); 712 703 servlen = sizeof(fcgi_addr_in); 713 704 … … 726 717 pid_t child; 727 718 int val; 728 struct stat st;729 719 730 720 if (!buffer_is_empty(proc->socket)) { … … 733 723 734 724 close(fcgi_fd); 735 736 /* can execv() work at all ? */737 if (-1 == stat(appPath, &st)) {738 log_error_write(srv, __FILE__, __LINE__, "sss",739 "stat failed for:", appPath, strerror(errno));740 return -1;741 }742 743 744 725 745 726 /* reopen socket */ … … 777 758 char_array env; 778 759 779 b = buffer_init();780 760 781 761 /* create environment */ … … 834 814 env.ptr[env.used] = NULL; 835 815 816 b = buffer_init(); 817 buffer_copy_string(b, "exec "); 818 buffer_append_string_buffer(b, host->bin_path); 819 836 820 /* exec the cgi */ 837 execle("/bin/sh", "sh", "-c", appPath, NULL, env.ptr);838 839 log_error_write(srv, __FILE__, __LINE__, "s ss",840 "execl failed for:", appPath, strerror(errno));821 execle("/bin/sh", "sh", "-c", b->ptr, NULL, env.ptr); 822 823 log_error_write(srv, __FILE__, __LINE__, "sbs", 824 "execl failed for:", host->bin_path, strerror(errno)); 841 825 842 826 exit(errno); … … 2262 2246 switch (fcgi_establish_connection(srv, hctx)) { 2263 2247 case 1: 2264 /* comeback here */2265 2248 fcgi_set_state(srv, hctx, FCGI_STATE_CONNECT); 2266 2249 2267 2250 joblist_append(srv, con); 2251 2252 /* connection is in progress, wait for an event and call getsockopt() below */ 2268 2253 2269 2254 return HANDLER_WAIT_FOR_EVENT; -
tests/Makefile.am
r25 r28 67 67 fastcgi-11.sh \ 68 68 fastcgi-12.sh \ 69 fastcgi-13.sh \ 69 70 auth-01.sh \ 70 71 auth-02.sh \ … … 106 107 fastcgi-11.conf \ 107 108 fastcgi-12.conf \ 109 fastcgi-13.conf \ 108 110 bug-06.conf \ 109 111 bug-12.conf

