diff -C 3 -r -N -XNOT apache_1.3.6/Makefile.tmpl apache_1.3.6_amiga/Makefile.tmpl *** apache_1.3.6/Makefile.tmpl Tue Mar 16 00:38:46 1999 --- apache_1.3.6_amiga/Makefile.tmpl Sun Jul 25 23:59:59 1999 *************** *** 201,207 **** # the install target for installing the complete Apache # package. This is implemented by running subtargets for the # separate parts of the installation process. ! install: @if [ ! -f $(TOP)/$(SRC)/.apaci.build.ok ]; then \ $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build; \ else \ --- 201,209 ---- # the install target for installing the complete Apache # package. This is implemented by running subtargets for the # separate parts of the installation process. ! yes-I-will-install-in-spite-of-INSTALL-file: ! ! install: yes-I-will-install-in-spite-of-INSTALL-file @if [ ! -f $(TOP)/$(SRC)/.apaci.build.ok ]; then \ $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build; \ else \ diff -C 3 -r -N -XNOT apache_1.3.6/config.status.68040 apache_1.3.6_amiga/config.status.68040 *** apache_1.3.6/config.status.68040 Thu Jan 1 00:00:00 1970 --- apache_1.3.6_amiga/config.status.68040 Mon Jul 26 16:48:41 1999 *************** *** 0 **** --- 1,26 ---- + #!/bin/sh + ## + ## config.status -- APACI auto-generated configuration restore script + ## + ## Use this shell script to re-run the APACI configure script for + ## restoring your configuration. Additional parameters can be supplied. + ## + + OPTIM="-m68040 -O2" \ + ./configure \ + "--with-layout=Apache" \ + "--prefix=/Apache/" \ + "--enable-module=mime_magic" \ + "--enable-module=info" \ + "--enable-module=proxy" \ + "--enable-module=rewrite" \ + "--enable-module=auth_anon" \ + "--enable-module=auth_dbm" \ + "--enable-module=digest" \ + "--enable-module=headers" \ + "--enable-module=expires" \ + "--enable-module=unique_id" \ + "--without-confadjust" \ + "$@" + exit 0 + diff -C 3 -r -N -XNOT apache_1.3.6/configure apache_1.3.6_amiga/configure *** apache_1.3.6/configure Wed Mar 10 11:53:02 1999 --- apache_1.3.6_amiga/configure Mon Jul 26 15:47:36 1999 *************** *** 905,910 **** --- 905,911 ---- -e 's:$:" \\:' >>$configstatus done echo '"$@"' >>$configstatus + echo 'exit 0' >>$configstatus echo '' >>$configstatus chmod a+x $configstatus diff -C 3 -r -N -XNOT apache_1.3.6/src/Configure apache_1.3.6_amiga/src/Configure *** apache_1.3.6/src/Configure Sun Mar 21 05:07:24 1999 --- apache_1.3.6_amiga/src/Configure Sun Jul 25 22:11:08 1999 *************** *** 283,288 **** --- 283,296 ---- LDFLAGS="$LDFLAGS -s" DEF_WANTHSREGEX=no ;; + *-*-AmigaOS*) + OS='amigaos' + OSDIR="os/amiga" + OPTIM="$OPTIM -m68020-40 -O2" + CFLAGS="$CFLAGS -resident32 -mstackextend -Dfork=vfork" + LDFLAGS="$LDFLAGS -resident32" + DEF_WANTHSREGEX=no + ;; i386-ibm-aix*) OS='IBM AIX PS/2' CFLAGS="$CFLAGS -DAIX=1 -U__STR__ -DUSEBCOPY" *************** *** 1914,1920 **** (cd \$\$i && \$(MAKE) \$(MFLAGS_STATIC) SDP='\$(SDP)' CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; \\ echo "<=== \$(SDP)modules/\$\$i"; \\ fi; \\ ! done EOF --- 1922,1929 ---- (cd \$\$i && \$(MAKE) \$(MFLAGS_STATIC) SDP='\$(SDP)' CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; \\ echo "<=== \$(SDP)modules/\$\$i"; \\ fi; \\ ! done; \\ ! true EOF diff -C 3 -r -N -XNOT apache_1.3.6/src/ap/ap_md5c.c apache_1.3.6_amiga/src/ap/ap_md5c.c *** apache_1.3.6/src/ap/ap_md5c.c Fri Mar 5 22:17:53 1999 --- apache_1.3.6_amiga/src/ap/ap_md5c.c Sun Jul 25 22:11:08 1999 *************** *** 585,591 **** * an explanatory text string if they don't. */ ! API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash) { char sample[120]; char *crypt_pw; --- 585,591 ---- * an explanatory text string if they don't. */ ! API_EXPORT(char *) ap_validate_password(const char *user, const char *passwd, const char *hash) { char sample[120]; char *crypt_pw; *************** *** 602,607 **** --- 602,624 ---- */ #ifdef WIN32 return "crypt() unavailable on Win32, cannot validate password"; + #elif AMIGA + { + char salt[2]; + char another_pw[24]={0,}; + + salt[0] = hash[0]; + salt[1] = hash[1]; + /* if MuFS is installed, crypt will return NULL */ + crypt_pw = crypt(passwd, salt); + if (crypt_pw == NULL) { + ACrypt(another_pw, (char *)passwd, (char *)user); + ap_cpystrn(sample, another_pw, sizeof(sample) - 1); + } + else { + ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + } + } #else crypt_pw = crypt(passwd, hash); ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); diff -C 3 -r -N -XNOT apache_1.3.6/src/buildmark.c apache_1.3.6_amiga/src/buildmark.c *** apache_1.3.6/src/buildmark.c Fri Jan 1 19:04:35 1999 --- apache_1.3.6_amiga/src/buildmark.c Sun Jul 25 22:14:08 1999 *************** *** 58,63 **** --- 58,67 ---- #include "ap_config.h" #include "httpd.h" + #ifdef AMIGA + static const char version[] = "$VER: Apache 1.3.6 (20.07.99)"; + #endif /* AMIGA */ + #if defined(__DATE__) && defined(__TIME__) static const char server_built[] = __DATE__ " " __TIME__; #else diff -C 3 -r -N -XNOT apache_1.3.6/src/helpers/GuessOS apache_1.3.6_amiga/src/helpers/GuessOS *** apache_1.3.6/src/helpers/GuessOS Sun Feb 7 23:26:51 1999 --- apache_1.3.6_amiga/src/helpers/GuessOS Sun Jul 25 22:17:24 1999 *************** *** 231,236 **** --- 231,240 ---- fi ;; + AmigaOS:*:*:*) + echo "m68k-unknown-AmigaOS"; exit 0; + ;; + NonStop-UX:4.[02]*:[BC]*:*) echo "${MACHINE}-tandem-sysv4"; exit 0; ;; diff -C 3 -r -N -XNOT apache_1.3.6/src/include/alloc.h apache_1.3.6_amiga/src/include/alloc.h *** apache_1.3.6/src/include/alloc.h Sun Mar 7 14:05:33 1999 --- apache_1.3.6_amiga/src/include/alloc.h Sun Jul 25 22:11:09 1999 *************** *** 126,131 **** --- 126,132 ---- API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); /* make a nul terminated copy of the n characters starting with s */ API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); + API_EXPORT_NONSTD(char *) ap_pvstrcat(struct pool *, va_list); API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *,...); /* all '...' must be char* */ API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, ...) __attribute__((format(printf,2,3))); diff -C 3 -r -N -XNOT apache_1.3.6/src/include/ap_config.h apache_1.3.6_amiga/src/include/ap_config.h *** apache_1.3.6/src/include/ap_config.h Tue Mar 16 16:16:07 1999 --- apache_1.3.6_amiga/src/include/ap_config.h Sun Jul 25 22:11:09 1999 *************** *** 280,285 **** --- 280,318 ---- #define NET_SIZE_T size_t #endif + #elif defined(AMIGA) + #include + #include + #include + #include + #include + #include + #define HAVE_SHMGET + #define USE_SHMGET_SCOREBOARD + #define HAVE_GMTOFF + #define USE_SYSVSEM_SERIALIZED_ACCEPT + #define NO_KILLPG + #define NO_SETSID + #define JMP_BUF sigjmp_buf + #undef NO_LINGCLOSE + #define NO_SLACK + #define HAVE_SYSLOG + #define SHM_R IPC_R + #define SHM_W IPC_W + #define SHM_M IPC_M + #define CHILD_ENV_VARIABLE "CHILD_NUMBER" + #define ACCEPT_CHILD_NUMBER 0 /* child number which does the accepting > 0 does a getmsg */ + #define ix_wait(pmask) ix_select(0, NULL, NULL, NULL, NULL, pmask) + #include + struct ChildMsg { + struct Message msg; + long id; + int inet; + int stream; + int protocol; + time_t restart_time; /* useful in server status */ + struct sockaddr sa_client; + }; #elif defined(ULTRIX) /* we don't want to use sys/resource.h under Ultrix although this header exists. */ diff -C 3 -r -N -XNOT apache_1.3.6/src/include/ap_md5.h apache_1.3.6_amiga/src/include/ap_md5.h *** apache_1.3.6/src/include/ap_md5.h Wed Feb 3 16:22:31 1999 --- apache_1.3.6_amiga/src/include/ap_md5.h Sun Jul 25 22:11:09 1999 *************** *** 110,116 **** API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context); API_EXPORT(void) ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); ! API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash); #ifdef __cplusplus } --- 110,116 ---- API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context); API_EXPORT(void) ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); ! API_EXPORT(char *) ap_validate_password(const char *user, const char *passwd, const char *hash); #ifdef __cplusplus } diff -C 3 -r -N -XNOT apache_1.3.6/src/include/http_conf_globals.h apache_1.3.6_amiga/src/include/http_conf_globals.h *** apache_1.3.6/src/include/http_conf_globals.h Fri Jan 1 19:04:39 1999 --- apache_1.3.6_amiga/src/include/http_conf_globals.h Sun Jul 25 22:20:40 1999 *************** *** 86,91 **** --- 86,92 ---- extern int ap_listenbacklog; extern int ap_dump_settings; extern API_VAR_EXPORT int ap_extended_status; + extern time_t ap_restart_time; extern char *ap_pid_fname; extern char *ap_scoreboard_fname; *************** *** 102,107 **** --- 103,112 ---- extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; extern char ap_server_confname[MAX_STRING_LEN]; + + extern pool *pconf; + extern pool *ptrans; + extern server_rec *server_conf; /* for -C, -c and -D switches */ extern array_header *ap_server_pre_read_config; diff -C 3 -r -N -XNOT apache_1.3.6/src/include/scoreboard.h apache_1.3.6_amiga/src/include/scoreboard.h *** apache_1.3.6/src/include/scoreboard.h Fri Jan 1 19:04:41 1999 --- apache_1.3.6_amiga/src/include/scoreboard.h Sun Jul 25 22:11:10 1999 *************** *** 159,164 **** --- 159,167 ---- char request[64]; /* We just want an idea... */ server_rec *vhostrec; /* What virtual host is being accessed? */ /* SEE ABOVE FOR SAFE USAGE! */ + #ifdef AMIGA + struct MsgPort *childport; + #endif } short_score; typedef struct { diff -C 3 -r -N -XNOT apache_1.3.6/src/main/alloc.c apache_1.3.6_amiga/src/main/alloc.c *** apache_1.3.6/src/main/alloc.c Sun Mar 7 14:05:34 1999 --- apache_1.3.6_amiga/src/main/alloc.c Sun Jul 25 22:33:32 1999 *************** *** 65,70 **** --- 65,71 ---- #include "httpd.h" #include "multithread.h" #include "http_log.h" + #include "http_conf_globals.h" #include *************** *** 747,765 **** API_EXPORT_NONSTD(char *) ap_pstrcat(pool *a,...) { ! char *cp, *argp, *res; ! ! /* Pass one --- find length of required string */ ! ! int len = 0; va_list adummy; va_start(adummy, a); ! while ((cp = va_arg(adummy, char *)) != NULL) ! len += strlen(cp); ! va_end(adummy); /* Allocate the required string */ --- 748,770 ---- API_EXPORT_NONSTD(char *) ap_pstrcat(pool *a,...) { ! char *res; va_list adummy; va_start(adummy, a); + res = ap_pvstrcat(a, adummy); + va_end(adummy); + } ! API_EXPORT_NONSTD(char *) ap_pvstrcat(pool *a, va_list va) ! { ! char *cp, *argp, *res; ! va_list adummy = va; ! /* Pass one --- find length of required string */ ! int len = 0; ! while ((cp = va_arg(adummy, char *)) != NULL) ! len += strlen(cp); /* Allocate the required string */ *************** *** 769,782 **** /* Pass two --- copy the argument strings into the result space */ ! va_start(adummy, a); ! ! while ((argp = va_arg(adummy, char *)) != NULL) { strcpy(cp, argp); cp += strlen(argp); } - va_end(adummy); /* Return the result string */ --- 774,784 ---- /* Pass two --- copy the argument strings into the result space */ ! while ((argp = va_arg(va, char *)) != NULL) { strcpy(cp, argp); cp += strlen(argp); } /* Return the result string */ *************** *** 860,865 **** --- 862,878 ---- #endif } + API_EXPORT_NONSTD(char *) ap_psprintf(pool *p, const char *fmt, ...) + { + va_list ap; + char *res; + + va_start(ap, fmt); + res = ap_pvsprintf(p, fmt, ap); + va_end(ap); + return res; + } + API_EXPORT(char *) ap_pvsprintf(pool *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC *************** *** 923,938 **** #endif } - API_EXPORT_NONSTD(char *) ap_psprintf(pool *p, const char *fmt, ...) - { - va_list ap; - char *res; - - va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); - va_end(ap); - return res; - } /***************************************************************** * --- 936,941 ---- *************** *** 1681,1689 **** --- 1684,1699 ---- * I can do about that (except if the child decides * to go out and close them */ + #ifndef AMIGA + /* + * Since Amiga vfork()s instead of fork()ing, the child's + * pool is the parent's pool, so cleaning it is a really + * BAD idea. + */ ap_block_alarms(); cleanup_pool_for_exec(permanent_pool); ap_unblock_alarms(); + #endif #endif /* ndef WIN32 */ } *************** *** 2022,2030 **** #define BINMODE #endif ! static pid_t spawn_child_core(pool *p, int (*func) (void *, child_info *), ! void *data,enum kill_conditions kill_how, ! int *pipe_in, int *pipe_out, int *pipe_err) { pid_t pid; int in_fds[2]; --- 2032,2050 ---- #define BINMODE #endif ! #ifdef AMIGA ! static pool *p; ! static int (*func)(void *, child_info *); ! static void *data; ! static enum kill_conditions kill_how; ! int *pipe_in; ! int *pipe_out; ! int *pipe_err; ! #endif ! ! static pid_t spawn_child_core(pool *_p, int (*_func) (void *, child_info *), ! void *_data, enum kill_conditions _kill_how, ! int *_pipe_in, int *_pipe_out, int *_pipe_err) { pid_t pid; int in_fds[2]; *************** *** 2032,2037 **** --- 2052,2072 ---- int err_fds[2]; int save_errno; + #ifndef AMIGA + pool *p; + int (*func)(void *); + void *data; + enum kill_conditions kill_how; + int *pipe_in, *pipe_out, *pipe_err; + #endif + p = _p; + func = _func; + data = _data; + kill_how = _kill_how; + pipe_in = _pipe_in; + pipe_out = _pipe_out; + pipe_err = _pipe_err; + if (pipe_in && os_pipe(in_fds) < 0) { return 0; } diff -C 3 -r -N -XNOT apache_1.3.6/src/main/http_main.c apache_1.3.6_amiga/src/main/http_main.c *** apache_1.3.6/src/main/http_main.c Wed Mar 17 23:05:43 1999 --- apache_1.3.6_amiga/src/main/http_main.c Sun Jul 25 23:00:56 1999 *************** *** 249,254 **** --- 249,256 ---- int ap_listenbacklog; int ap_dump_settings = 0; API_VAR_EXPORT int ap_extended_status = 0; + char **prog_argv; + int prog_argc; /* * The max child slot ever assigned, preserved across restarts. Necessary *************** *** 287,293 **** /* *Non*-shared http_main globals... */ ! static server_rec *server_conf; static JMP_BUF APACHE_TLS jmpbuffer; static int sd; static fd_set listenfds; --- 289,295 ---- /* *Non*-shared http_main globals... */ ! server_rec *server_conf; static JMP_BUF APACHE_TLS jmpbuffer; static int sd; static fd_set listenfds; *************** *** 329,342 **** static other_child_rec *other_children; #endif ! static pool *pconf; /* Pool for config stuff */ ! static pool *ptrans; /* Pool for per-transaction stuff */ ! static pool *pchild; /* Pool for httpd child stuff */ ! static pool *pcommands; /* Pool for -C and -c switches */ static int APACHE_TLS my_pid; /* it seems silly to call getpid all the time */ #ifndef MULTITHREAD ! static int my_child_num; #endif scoreboard *ap_scoreboard_image = NULL; --- 331,344 ---- static other_child_rec *other_children; #endif ! pool *pconf; /* Pool for config stuff */ ! pool *ptrans; /* Pool for per-transaction stuff */ ! pool *pchild; /* Pool for httpd child stuff */ ! pool *pcommands; /* Pool for -C and -c switches */ static int APACHE_TLS my_pid; /* it seems silly to call getpid all the time */ #ifndef MULTITHREAD ! static int my_child_num = -1; #endif scoreboard *ap_scoreboard_image = NULL; *************** *** 396,402 **** * This routine adds the real server base identity to the version string, * and then locks out changes until the next reconfig. */ ! static void ap_set_version(void) { if (ap_server_tokens == SrvTk_MIN) { ap_add_version_component(SERVER_BASEVERSION); --- 398,404 ---- * This routine adds the real server base identity to the version string, * and then locks out changes until the next reconfig. */ ! void ap_set_version(void) { if (ap_server_tokens == SrvTk_MIN) { ap_add_version_component(SERVER_BASEVERSION); *************** *** 458,463 **** --- 460,476 ---- if (pchild) { ap_child_exit_modules(pchild, server_conf); ap_destroy_pool(pchild); + + #ifdef AMIGA + if (my_child_num > 0) { + short_score *ss = &ap_scoreboard_image->servers[my_child_num]; + if (ss->childport != NULL) + DeleteMsgPort(ss->childport); + ss->childport = NULL; + /* Recycle the slot */ + ss->status = SERVER_DEAD; + } + #endif } chdir_for_gprof(); exit(code); *************** *** 1164,1170 **** if (child_timeouts) { old = alarm(x); } ! else { /* Just note the timeout in our scoreboard, no need to call the system. * We also note that the virtual time has gone forward. */ --- 1177,1183 ---- if (child_timeouts) { old = alarm(x); } ! else if (my_child_num >= 0) { /* Just note the timeout in our scoreboard, no need to call the system. * We also note that the virtual time has gone forward. */ *************** *** 1792,1798 **** --- 1805,1816 ---- } #elif defined(USE_SHMGET_SCOREBOARD) + #ifdef AMIGA + /* Since the children need to know what key to use, use this one. */ + static key_t shmkey = 519885; + #else static key_t shmkey = IPC_PRIVATE; + #endif static int shmid = -1; static void setup_shared_mem(pool *p) *************** *** 1860,1870 **** --- 1878,1891 ---- * We must avoid leaving segments in the kernel's * (small) tables. */ + #ifndef AMIGA if (shmctl(shmid, IPC_RMID, NULL) != 0) { ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "shmctl: IPC_RMID: could not remove shared memory segment #%d", shmid); } + #endif + if (ap_scoreboard_image == BADSHMAT) /* now bailout */ exit(APEXIT_INIT); *************** *** 1881,1886 **** --- 1902,1925 ---- static void reopen_scoreboard(pool *p) { + #ifdef AMIGA + struct shmid_ds shmbuf; + + if ((shmid = shmget(shmkey, SCOREBOARD_SIZE, SHM_R | SHM_W)) == -1) { + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, + "could not call shmget"); + exit(APEXIT_INIT); + } + + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, + "reopened shared memory segment #%d", shmid); + + if ((ap_scoreboard_image = (scoreboard *) shmat(shmid, 0, 0)) == BADSHMAT) { + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "shmat error"); + shmctl(shmid, IPC_RMID, NULL); + exit(APEXIT_INIT); + } + #endif } #else *************** *** 2219,2224 **** --- 2258,2266 ---- "child process %d did not exit, sending another SIGHUP", pid); kill(pid, SIGHUP); + #ifdef AMIGA /* need to call waitpid() to clean up resources */ + waitpid(pid, NULL, WNOHANG); + #endif waittime = 1024 * 16; break; case 4: /* 16ms */ *************** *** 2232,2237 **** --- 2274,2282 ---- "child process %d still did not exit, sending a SIGTERM", pid); kill(pid, SIGTERM); + #ifdef AMIGA /* need to call waitpid() to clean up resources */ + waitpid(pid, NULL, WNOHANG); + #endif break; case 8: /* 6 sec */ /* die child scum */ *************** *** 2239,2244 **** --- 2284,2292 ---- "child process %d still did not exit, sending a SIGKILL", pid); kill(pid, SIGKILL); + #ifdef AMIGA /* need to call waitpid() to clean up resources */ + waitpid(pid, NULL, WNOHANG); + #endif break; case 9: /* 14 sec */ /* gave it our best shot, but alas... If this really *************** *** 2279,2284 **** --- 2327,2335 ---- break; } } + #ifdef AMIGA + wait(0); + #endif #endif /* ndef MULTITHREAD */ } *************** *** 2732,2737 **** --- 2783,2793 ---- sa.sa_handler = sig_term; if (sigaction(SIGTERM, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGTERM)"); + #ifdef AMIGA + if (sigaction(SIGINT, &sa, NULL) < 0) + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGINT)"); + #endif + #ifdef SIGINT if (sigaction(SIGINT, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGINT)"); *************** *** 2787,2792 **** --- 2843,2851 ---- #ifdef SIGHUP signal(SIGHUP, restart); #endif /* SIGHUP */ + #ifdef AMIGA + signal(SIGINT, sig_term); + #endif #ifdef SIGUSR1 signal(SIGUSR1, restart); #endif /* SIGUSR1 */ *************** *** 2807,2812 **** --- 2866,2872 ---- #if !defined(WIN32) int x; + #ifndef AMIGA chdir("/"); #if !defined(MPE) && !defined(OS2) && !defined(TPF) /* Don't detach for MPE because child processes can't survive the death of *************** *** 2820,2825 **** --- 2880,2886 ---- } RAISE_SIGSTOP(DETACH); #endif + #endif /* AMIGA */ #ifndef NO_SETSID if ((pgrp = setsid()) == -1) { perror("setsid"); *************** *** 2918,2927 **** --- 2979,2990 ---- } #endif if (setgid(ap_group_id) == -1) { + #ifndef AMIGA /* This will fail with MuFS installed. Oh well... */ ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setgid: unable to set group id to Group %u", (unsigned)ap_group_id); clean_child_exit(APEXIT_CHILDFATAL); + #endif } #endif } *************** *** 3465,3471 **** * some of it is #ifdef'd but was duplicated before anyhow. This stuff * is still a mess. */ ! static void common_init(void) { INIT_SIGLIST() #ifdef AUX3 --- 3528,3534 ---- * some of it is #ifdef'd but was duplicated before anyhow. This stuff * is still a mess. */ ! void common_init(void) { INIT_SIGLIST() #ifdef AUX3 *************** *** 3514,3519 **** --- 3577,3588 ---- struct sockaddr sa_server; struct sockaddr sa_client; listen_rec *lr; + #ifdef AMIGA + struct ChildMsg *msg; + int currentchild = 0; + short_score *ss; + #endif + /* All of initialization is a critical section, we don't care if we're * told to HUP or USR1 before we're done initializing. For example, *************** *** 3540,3547 **** /* needs to be done before we switch UIDs so we have permissions */ reopen_scoreboard(pchild); - SAFE_ACCEPT(accept_mutex_child_init(pchild)); set_group_privs(); #ifdef MPE /* Only try to switch if we're running as MANAGER.SYS */ --- 3609,3628 ---- /* needs to be done before we switch UIDs so we have permissions */ reopen_scoreboard(pchild); + #ifdef AMIGA + ss = &ap_scoreboard_image->servers[child_num_arg]; + + ss->childport = CreateMsgPort(); /* This better succeed */ + + if (my_child_num == ACCEPT_CHILD_NUMBER) { + ap_restart_time = time(NULL); + setup_listeners(pconf); + SAFE_ACCEPT(accept_mutex_child_init(pchild)); + } + #else + SAFE_ACCEPT(accept_mutex_child_init(pchild)); + #endif set_group_privs(); #ifdef MPE /* Only try to switch if we're running as MANAGER.SYS */ *************** *** 3620,3625 **** --- 3701,3709 ---- } #ifndef WIN32 + #ifdef AMIGA /* Don't let the ACCEPT_CHILD_NUMBER process to die */ + if (!one_process && my_child_num != ACCEPT_CHILD_NUMBER) + #endif if ((ap_max_requests_per_child > 0 && requests_this_child++ >= ap_max_requests_per_child)) { clean_child_exit(0); *************** *** 3635,3647 **** */ /* Lock around "accept", if necessary */ SAFE_ACCEPT(accept_mutex_on()); - for (;;) { if (ap_listeners->next != ap_listeners) { /* more than one socket */ memcpy(&main_fds, &listenfds, sizeof(fd_set)); srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, NULL); if (srv < 0 && errno != EINTR) { /* Single Unix documents select as returning errnos --- 3719,3742 ---- */ /* Lock around "accept", if necessary */ + #ifdef AMIGA + if (one_process || my_child_num == ACCEPT_CHILD_NUMBER) { + #endif SAFE_ACCEPT(accept_mutex_on()); for (;;) { + struct timeval timeout = {1,0}; + if (ap_listeners->next != ap_listeners) { /* more than one socket */ memcpy(&main_fds, &listenfds, sizeof(fd_set)); + #ifdef AMIGA + /* avoid starvation */ + head_listener = head_listener->next; + + srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, &timeout); + #else srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, NULL); + #endif if (srv < 0 && errno != EINTR) { /* Single Unix documents select as returning errnos *************** *** 3763,3769 **** SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */ ! /* We've got a socket, let's at least process one request off the * socket before we accept a graceful restart request. */ signal(SIGUSR1, SIG_IGN); --- 3858,3961 ---- SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */ ! /* We've got a socket, let's at least process one request off the list */ ! #ifdef AMIGA ! if (!one_process) { ! long mask = 1 << ss->childport->mp_SigBit; ! msg = (struct ChildMsg *)malloc(sizeof(struct ChildMsg)); ! if (msg != NULL) { ! int i; ! long id; ! int donemsg = 0; ! ! id = ix_release_socket(csd); ! close(csd); ! ! msg->id = id; ! msg->inet = AF_INET; ! msg->stream = SOCK_STREAM; ! msg->protocol = IPPROTO_TCP; ! msg->sa_client = sa_client; ! msg->msg.mn_ReplyPort = ss->childport; ! msg->restart_time = ap_restart_time; /* pass this to the child used in mod_status */ ! ! /* Find a ready child */ ! /* Keep track of the last child we've processed ! * as to keep a good round robin reply going which ! * shouldn't starve anyone ! */ ! while (!donemsg) { ! for (i = 0;i < HARD_SERVER_LIMIT; i++) { ! short_score *child; ! currentchild = (currentchild + 1) % HARD_SERVER_LIMIT; ! ! if (currentchild == ACCEPT_CHILD_NUMBER) ! continue; ! ! child = &ap_scoreboard_image->servers[currentchild]; ! if (child->status == SERVER_READY) { ! PutMsg(child->childport, (struct Message *)msg); ! donemsg = 1; ! break; ! } ! } ! /* Woah, all the servers are in use, ! * sleep for a bit so the parent ! * can start a new child ! */ ! if (!donemsg) ! sleep(1); ! } ! } ! ! /* ! * Disable multitasking since some other task maybe replying to its message ! */ ! Forbid(); ! while (msg = (struct ChildMsg *)GetMsg(ss->childport)) { ! free(msg); ! } ! Permit(); ! /* This guy doesn't respond to the messages */ ! continue; ! } ! } ! else { ! /* Helper processes which waits for the socket from child 0 */ ! for(;;) { ! ! msg = (struct ChildMsg *)GetMsg(ss->childport); ! if (msg != NULL) ! break; ! ! for(;;) { ! /* Wakeup every second so that the kill signal can be ! * processed if any. ! * WaitPort() blocks the whole process so that the signals ! * don't get through ! */ ! long mask = 1 << ss->childport->mp_SigBit; ! struct timeval timeout = {1,0}; ! int s = ix_select(0, NULL, NULL, NULL, &timeout, &mask); ! ! if (mask & (1 << ss->childport->mp_SigBit)) ! break; ! } ! } ! ! csd = ix_obtain_socket(msg->id, msg->inet, msg->stream, msg->protocol); ! ! sa_client = msg->sa_client; ! ap_restart_time = msg->restart_time; ! ! /* tell my parent I am done with this message */ ! ReplyMsg((struct Message *)msg); ! ! if (csd == -1) ! continue; ! } ! #endif ! /* * socket before we accept a graceful restart request. */ signal(SIGUSR1, SIG_IGN); *************** *** 3910,3915 **** --- 4102,4108 ---- static int make_child(server_rec *s, int slot, time_t now) { int pid; + char buf[10]; if (slot + 1 > max_daemons_limit) { max_daemons_limit = slot + 1; *************** *** 3924,3930 **** --- 4117,4125 ---- } /* avoid starvation */ + #ifndef AMIGA head_listener = head_listener->next; + #endif Explain1("Starting new child in slot %d", slot); (void) ap_update_child_status(slot, SERVER_STARTING, (request_rec *) NULL); *************** *** 3973,3979 **** --- 4168,4186 ---- signal(SIGHUP, just_die); signal(SIGUSR1, just_die); signal(SIGTERM, just_die); + + /* Instead of using ix_vfork(), ix_setup_child() , ix_vfork_resume() + * like I did before, do an exec with a special environment variable + * which tells the started process to start running as a child + */ + #ifdef AMIGA + sprintf(buf,"%d", slot); + + setenv(CHILD_ENV_VARIABLE, buf, 1); + execv(prog_argv[0], prog_argv); + #else child_main(slot); + #endif } #ifdef OPTIMIZE_TIMEOUTS *************** *** 4252,4258 **** --- 4459,4467 ---- ptrans = ap_make_sub_pool(pconf); server_conf = ap_read_config(pconf, ptrans, ap_server_confname); + #ifndef AMIGA setup_listeners(pconf); + #endif ap_open_logs(server_conf, pconf); ap_log_pid(pconf, ap_pid_fname); ap_set_version(); /* create our server_version string */ *************** *** 4274,4279 **** --- 4483,4494 ---- if (ap_daemons_max_free < ap_daemons_min_free + 1) /* Don't thrash... */ ap_daemons_max_free = ap_daemons_min_free + 1; + /* Start up the accept monitor */ + #ifdef AMIGA + make_child(server_conf, ACCEPT_CHILD_NUMBER, time(0)); + #endif + + /* If we're doing a graceful_restart then we're going to see a lot * of children exiting immediately when we get into the main loop * below (because we just sent them SIGUSR1). This happens pretty *************** *** 4467,4472 **** --- 4682,4690 ---- int sock_out; char *s; + prog_argc = argc; + prog_argv = argv; + #ifdef SecureWare if (set_auth_parameters(argc, argv) < 0) perror("set_auth_parameters"); *************** *** 4581,4593 **** exit(0); } child_timeouts = !ap_standalone || one_process; if (ap_standalone) { ap_open_logs(server_conf, pconf); ap_set_version(); ap_init_modules(pconf, server_conf); - version_locked++; STANDALONE_MAIN(argc, argv); } else { --- 4799,4823 ---- exit(0); } + #ifdef AMIGA + { + char *child_num; + if ((child_num = getenv(CHILD_ENV_VARIABLE)) != NULL) { + ap_open_logs(server_conf, pconf); + ap_set_version(); + ap_init_modules(pconf, server_conf); + version_locked++; + child_main(atoi(child_num)); + } + } + #endif + child_timeouts = !ap_standalone || one_process; if (ap_standalone) { ap_open_logs(server_conf, pconf); ap_set_version(); ap_init_modules(pconf, server_conf); STANDALONE_MAIN(argc, argv); } else { *************** *** 4684,4690 **** --- 4914,4934 ---- ap_destroy_pool(r->pool); } + #ifdef NO_LINGCLOSE + ap_bclose(cio); /* just close it */ + #else + if (r && r->connection + && !r->connection->aborted + && r->connection->client + && (r->connection->client->fd >= 0)) { + + lingering_close(r); + } + else { + ap_bsetflag(cio, B_EOUT, 1); ap_bclose(cio); + } + #endif } exit(0); } diff -C 3 -r -N -XNOT apache_1.3.6/src/main/http_request.c apache_1.3.6_amiga/src/main/http_request.c *** apache_1.3.6/src/main/http_request.c Sun Mar 7 15:05:36 1999 --- apache_1.3.6_amiga/src/main/http_request.c Sun Jul 25 22:50:06 1999 *************** *** 266,272 **** --- 266,279 ---- return OK; } #if defined(ENOENT) && defined(ENOTDIR) + + #ifdef AMIGA /* stat is broken, it returns EINVAL for /foo/bar where + * /foo exists and is a file + */ + else if (errno == ENOENT || errno == ENOTDIR || errno == EINVAL) { + #else else if (errno == ENOENT || errno == ENOTDIR) { + #endif last_cp = cp; while (--cp > path && *cp != '/') *************** *** 436,441 **** --- 443,457 ---- */ if (num_dirs > 3 && test_filename[0] == '/' && test_filename[1] == '/') iStart = 4; + #endif + + #ifdef AMIGA + /* If the filename starts with '/' don't test the first slash since + * /xxx maps to xxx: which is not always what we want. An example of + * this is /.htaccess + */ + if (test_filename[0] == '/') + iStart++; #endif /* j keeps track of which section we're on, see core_reorder_directories */ diff -C 3 -r -N -XNOT apache_1.3.6/src/main/util.c apache_1.3.6_amiga/src/main/util.c *** apache_1.3.6/src/main/util.c Sat Mar 20 15:41:07 1999 --- apache_1.3.6_amiga/src/main/util.c Sun Jul 25 22:11:12 1999 *************** *** 425,430 **** --- 425,444 ---- l = 0; name[l] = '\0'; } + + #ifdef AMIGA + /* e) Translate ':' to '/' -- ':' is a security hole */ + for (l = 0, w = 0; name[l] != '\0'; l++) { + if (name[l] != ':') { + name[w++] = name[l]; + } + else { + name[w++] = '/'; + } + } + name[w] = '\0'; + #endif + } API_EXPORT(void) ap_no2slash(char *name) *************** *** 470,479 **** --- 484,500 ---- for (;;) { *d = *s; if (*d == '\0') { + #ifdef AMIGA + if (*(d-1) != ':') + #endif *d = '/'; break; } + #ifdef AMIGA + if ((*d == '/' || *d == ':') && (--n) == 0) + #else if (*d == '/' && (--n) == 0) + #endif break; ++d; ++s; *************** *** 492,498 **** --- 513,523 ---- char *d; int l; + #ifdef AMIGA + if (last_slash == NULL && (last_slash = strchr(s, ':')) == NULL) { + #else if (last_slash == NULL) { + #endif /* XXX: well this is really broken if this happens */ return (ap_pstrdup(p, "/")); } *************** *** 535,541 **** --- 560,570 ---- register int x, n; for (x = 0, n = 0; path[x]; x++) + #ifdef AMIGA + if (path[x] == '/' || path[x] == ':') + #else if (path[x] == '/') + #endif n++; return n; } *************** *** 547,553 **** --- 576,586 ---- char buf[HUGE_STRING_LEN]; x = strrchr(file, '/'); + #ifdef AMIGA /* Beware the dreaded ':' */ + if (x == NULL && (x = strchr(x, ':')) == NULL) { + #else if (x == NULL) { + #endif chdir(file); } else if (x - file < sizeof(buf) - 1) { *************** *** 1570,1576 **** --- 1603,1613 ---- if (x == 0) return ap_pstrcat(a, "/", src2, NULL); + #ifdef AMIGA /* Beware the dreaded ':' */ + if ( (src1[x - 1] != '/') && (src1[x - 1] != ':') ) + #else if (src1[x - 1] != '/') + #endif return ap_pstrcat(a, src1, "/", src2, NULL); else return ap_pstrcat(a, src1, src2, NULL); diff -C 3 -r -N -XNOT apache_1.3.6/src/main/util_script.c apache_1.3.6_amiga/src/main/util_script.c *** apache_1.3.6/src/main/util_script.c Wed Mar 10 18:09:44 1999 --- apache_1.3.6_amiga/src/main/util_script.c Mon Jul 26 17:23:32 1999 *************** *** 1001,1007 **** return (pid); } ! #else if (ap_suexec_enabled && ((r->server->server_uid != ap_user_id) || (r->server->server_gid != ap_group_id) --- 1001,1031 ---- return (pid); } ! #elif defined(AMIGA) ! /* Not all programs are compiled to use ixemul.library ! * Their local variables are passed using GetVar, SetVar ! * So I must also pass it to them this way ! */ ! if (env) { ! char *envvar; ! char *equal; ! char *value; ! int i; ! ! for (i = 0; env[i] != (char *)0; i++) { ! envvar = env[i]; ! equal = strchr(envvar, '='); ! if (equal) { ! char variable[equal-envvar+1]; ! ! variable[equal-envvar] = '\0'; ! strncpy(variable,envvar, equal-envvar); ! value = equal+1; ! SetVar(variable, value, -1, GVF_LOCAL_ONLY); ! } ! } ! } ! #endif if (ap_suexec_enabled && ((r->server->server_uid != ap_user_id) || (r->server->server_gid != ap_group_id) *************** *** 1075,1080 **** --- 1099,1153 ---- env); } } + #if defined(AMIGA) /* allow ARexx scripts to be run */ + else { + + if (shellcmd) + execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env); + + else { + FILE *rxfile; + int isrexx = 0; + char err_string[512]; + int chr, chr2; + + rxfile = fopen(r->filename, "r"); + if (!rxfile) { + return; + } + + /* skip the leading white space */ + while(isspace((chr=fgetc(rxfile)))) + ; + + /* all ARexx files start with comment header */ + if (chr == '/' && (chr2 = fgetc(rxfile)) == '*') { + isrexx = 1; + } + + fclose(rxfile); + + if((!r->args) || (!r->args[0]) || strchr(r->args,'=')) { + if (isrexx) { + execle("/apache/bin/rx-gate", argv0, NULL, env); + } + else { + execle(r->filename, argv0, NULL, env); + } + } + else { + if (isrexx) { + execve("/apache/bin/rx-gate", + create_argv(r->pool, NULL, NULL, NULL, argv0, r->args), env); + } + else { + execve(r->filename, + create_argv(r->pool, NULL, NULL, NULL, argv0, r->args), env); + } + } + } + } + #else else { if (shellcmd) { execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env); diff -C 3 -r -N -XNOT apache_1.3.6/src/modules/standard/mod_auth.c apache_1.3.6_amiga/src/modules/standard/mod_auth.c *** apache_1.3.6/src/modules/standard/mod_auth.c Wed Feb 3 16:22:32 1999 --- apache_1.3.6_amiga/src/modules/standard/mod_auth.c Sun Jul 25 22:11:13 1999 *************** *** 218,224 **** ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } ! invalid_pw = ap_validate_password(sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "user %s: authentication failure for \"%s\": %s", --- 218,224 ---- ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } ! invalid_pw = ap_validate_password(c->user, sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "user %s: authentication failure for \"%s\": %s", diff -C 3 -r -N -XNOT apache_1.3.6/src/modules/standard/mod_auth_db.c apache_1.3.6_amiga/src/modules/standard/mod_auth_db.c *** apache_1.3.6/src/modules/standard/mod_auth_db.c Wed Feb 3 16:22:32 1999 --- apache_1.3.6_amiga/src/modules/standard/mod_auth_db.c Sun Jul 25 22:11:13 1999 *************** *** 249,255 **** if (colon_pw) { *colon_pw = '\0'; } ! invalid_pw = ap_validate_password(sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "DB user %s: authentication failure for \"%s\": %s", --- 249,255 ---- if (colon_pw) { *colon_pw = '\0'; } ! invalid_pw = ap_validate_password(c->user, sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "DB user %s: authentication failure for \"%s\": %s", diff -C 3 -r -N -XNOT apache_1.3.6/src/modules/standard/mod_auth_dbm.c apache_1.3.6_amiga/src/modules/standard/mod_auth_dbm.c *** apache_1.3.6/src/modules/standard/mod_auth_dbm.c Wed Feb 3 16:22:32 1999 --- apache_1.3.6_amiga/src/modules/standard/mod_auth_dbm.c Sun Jul 25 22:11:14 1999 *************** *** 231,237 **** if (colon_pw) { *colon_pw = '\0'; } ! invalid_pw = ap_validate_password(sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "DBM user %s: authentication failure for \"%s\": %s", --- 231,237 ---- if (colon_pw) { *colon_pw = '\0'; } ! invalid_pw = ap_validate_password(c->user, sent_pw, real_pw); if (invalid_pw != NULL) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "DBM user %s: authentication failure for \"%s\": %s", diff -C 3 -r -N -XNOT apache_1.3.6/src/modules/standard/mod_autoindex.c apache_1.3.6_amiga/src/modules/standard/mod_autoindex.c *** apache_1.3.6/src/modules/standard/mod_autoindex.c Mon Jan 4 19:49:41 1999 --- apache_1.3.6_amiga/src/modules/standard/mod_autoindex.c Sun Jul 25 22:11:14 1999 *************** *** 148,158 **** --- 148,166 ---- } autoindex_config_rec; + #ifdef AMIGA + /* the addresses change when the children are forked so this is flawed */ + /* I think this and the original code is a bad hack too! */ + #define BY_ENCODING (char *)0x01234567 + #define BY_PATH (char *)0x98765432 + #define BY_TYPE (char *)0x90ABCDEF + #else static char c_by_encoding, c_by_type, c_by_path; #define BY_ENCODING &c_by_encoding #define BY_TYPE &c_by_type #define BY_PATH &c_by_path + #endif /* * Return true if the specified string refers to the parent directory (i.e., diff -C 3 -r -N -XNOT apache_1.3.6/src/modules/standard/mod_userdir.c apache_1.3.6_amiga/src/modules/standard/mod_userdir.c *** apache_1.3.6/src/modules/standard/mod_userdir.c Sun Mar 7 13:13:54 1999 --- apache_1.3.6_amiga/src/modules/standard/mod_userdir.c Sun Jul 25 23:47:56 1999 *************** *** 299,304 **** --- 299,310 ---- #ifdef OS2 /* Need to manually add user name for OS/2 */ filename = ap_pstrcat(r->pool, pw->pw_dir, w, "/", userdir, NULL); + #elif defined(AMIGA) + char *plce = strchr(pw->pw_dir,'\0'); + if (plce[-1] != '/' && plce[-1] != ':') + filename = ap_pstrcat (r->pool, pw->pw_dir, "/", userdir, NULL); + else + filename = ap_pstrcat (r->pool, pw->pw_dir, userdir, NULL); #else filename = ap_pstrcat(r->pool, pw->pw_dir, "/", userdir, NULL); #endif diff -C 3 -r -N -XNOT apache_1.3.6/src/os/amiga/Makefile.tmpl apache_1.3.6_amiga/src/os/amiga/Makefile.tmpl *** apache_1.3.6/src/os/amiga/Makefile.tmpl Thu Jan 1 00:00:00 1970 --- apache_1.3.6_amiga/src/os/amiga/Makefile.tmpl Sun Jul 25 23:28:24 1999 *************** *** 0 **** --- 1,42 ---- + CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) + LIBS=$(EXTRA_LIBS) $(LIBS1) + INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) + LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + + OBJS= os.o + #os-inline.o #empty at the moment + + LIB= libos.a + + all: $(LIB) + + $(LIB): $(OBJS) + rm -f $@ + ar cr $@ $(OBJS) + $(RANLIB) $@ + + .c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $< + + clean: + rm -f $(OBJS) $(LIB) + + distclean: clean + -rm -f Makefile + + # We really don't expect end users to use this rule. It works only with + # gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after + # using it. + depend: + cp Makefile.tmpl Makefile.tmpl.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.tmpl \ + && rm Makefile.new + + $(OBJS): Makefile + + # DO NOT REMOVE + os.o: os.c os-inline.c diff -C 3 -r -N -XNOT apache_1.3.6/src/os/amiga/os-inline.c apache_1.3.6_amiga/src/os/amiga/os-inline.c *** apache_1.3.6/src/os/amiga/os-inline.c Thu Jan 1 00:00:00 1970 --- apache_1.3.6_amiga/src/os/amiga/os-inline.c Sun Jul 25 22:11:15 1999 *************** *** 0 **** --- 1,27 ---- + /* + * This file contains functions which can be inlined if the compiler + * has an "inline" modifier. Because of this, this file is both a + * header file and a compilable module. + * + * Only inlineable functions should be defined in here. They must all + * include the INLINE modifier. + * + * If the compiler supports inline, this file will be #included as a + * header file from os.h to create all the inline function + * definitions. INLINE will be defined to whatever is required on + * function definitions to make them inline declarations. + * + * If the compiler does not support inline, this file will be compiled + * as a normal C file into libos.a (along with os.c). In this case + * INLINE will _not_ be set so we can use this to test if we are + * compiling this source file. + */ + + #ifndef INLINE + #define INLINE + + /* Anything required only when compiling */ + + #endif + + diff -C 3 -r -N -XNOT apache_1.3.6/src/os/amiga/os.c apache_1.3.6_amiga/src/os/amiga/os.c *** apache_1.3.6/src/os/amiga/os.c Thu Jan 1 00:00:00 1970 --- apache_1.3.6_amiga/src/os/amiga/os.c Mon Jul 26 16:46:37 1999 *************** *** 0 **** --- 1,47 ---- + /* + * This file will include OS specific functions which are not inlineable. + * Any inlineable functions should be defined in os-inline.c instead. + */ + + #include "os.h" + #include "httpd.h" + + char *ap_os_canonical_filename (pool *p, const char *file) + { + char *dot; + char *retval; + + /* empty filename */ + if (!file) + return ap_pstrdup (p, ""); + + /* filenames containing no ':' are either relative or already canonical */ + if (file[0] == '/' || strchr(file, ':') == (char *)0) { + return ap_pstrdup (p, file); + } + + /* Translate Device:path/more/path/ to /Device/path/more/path */ + retval = ap_pstrcat (p, "/", file, NULL); + if (retval != (char *)0) { + dot = strchr (retval, ':'); + if (dot != (char *)0) + *dot = '/'; + } + + return retval; + } + + int ap_os_is_path_absolute (const char *file) + { + if (!file) return 0; + if (file[0] == '/') return 1; + if (strchr(file, ':') == (char *)0) return 0; + + if (strncmp (file, "proxy:", 6) == 0) return 0; + if (strncmp (file, "http:", 5) == 0) return 0; + if (strncmp (file, "ftp:", 4) == 0) return 0; + if (strncmp (file, "gopher:", 7) == 0) return 0; + + return 1; + } + diff -C 3 -r -N -XNOT apache_1.3.6/src/os/amiga/os.h apache_1.3.6_amiga/src/os/amiga/os.h *** apache_1.3.6/src/os/amiga/os.h Thu Jan 1 00:00:00 1970 --- apache_1.3.6_amiga/src/os/amiga/os.h Sun Jul 25 22:11:16 1999 *************** *** 0 **** --- 1,31 ---- + #ifndef APACHE_OS_H + #define APACHE_OS_H + /* + * This file in included in all Apache source code. It contains definitions + * of facilities available on _this_ operating system (HAVE_* macros), + * and prototypes of OS specific functions defined in os.c or os-inline.c + */ + + #define PLATFORM "AMIGA" + + #define HAVE_CANONICAL_FILENAME + + #if !defined(INLINE) && defined(USE_GNU_INLINE) + /* Compiler supports inline, so include the inlineable functions as + * part of the header + */ + #define INLINE extern ap_inline + #include "os-inline.c" + #endif + + #ifndef INLINE + /* Compiler does not support inline, so prototype the inlineable functions + * as normal + */ + #endif + + /* Other ap_os_ routines not used by this platform */ + + #define ap_os_is_filename_valid(f) (1) + + #endif /*APACHE_OS_H*/