randy 98/02/03 12:00:59
Modified: src/ap Makefile.tmpl src/include ap.h src/main buff.c Removed: src/ap ap_read.c ap_write.c Log: Back out controversial abstraction of read()/write(). As couple of people have pointed out, this is probably too major a change this late in the game. My main intent was to clean up some of the code where read()/write() is called in buff.c. Putting these in libap seemed the logical place, but opens a whole can of worms I did not forsee. Revision Changes Path 1.11 +1 -3 apache-1.3/src/ap/Makefile.tmpl Index: Makefile.tmpl =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/Makefile.tmpl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Makefile.tmpl 1998/02/03 02:41:19 1.10 +++ Makefile.tmpl 1998/02/03 20:00:55 1.11 @@ -7,7 +7,7 @@ LIB=libap.a OBJS=ap_signal.o ap_slack.o ap_snprintf.o ap_strings.o ap_cpystrn.o \ - ap_execve.o ap_read.o ap_write.o + ap_execve.o .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $< @@ -31,5 +31,3 @@ ap_strings.o: $(INCDIR)/httpd.h ap_cpystrn.o: $(INCDIR)/httpd.h ap_execve.o: $(INCDIR)/httpd.h $(INCDIR)/http_log.h -ap_read.o: $(INCDIR)/httpd.h -ap_write.o: $(INCDIR)/httpd.h 1.6 +0 -2 apache-1.3/src/include/ap.h Index: ap.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/ap.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ap.h 1998/02/03 02:41:21 1.5 +++ ap.h 1998/02/03 20:00:57 1.6 @@ -57,8 +57,6 @@ #ifndef APACHE_AP_H #define APACHE_AP_H -API_EXPORT(int) ap_read(BUFF *fb, void *buf, int nbyte); -API_EXPORT(int) ap_write(BUFF *fb, const void *buf, int nbyte); API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); int ap_slack(int, int); API_EXPORT(char *) ap_escape_quotes(pool *, const char *); 1.62 +23 -0 apache-1.3/src/main/buff.c Index: buff.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/buff.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- buff.c 1998/02/03 02:41:22 1.61 +++ buff.c 1998/02/03 20:00:58 1.62 @@ -221,7 +221,17 @@ #endif /* WIN32 */ + /* the lowest level reading primitive */ +static int ap_read(BUFF *fb, void *buf, int nbyte) +{ + int rv; + + rv = read(fb->fd_in, buf, nbyte); + + return rv; +} + static ap_inline int buff_read(BUFF *fb, void *buf, int nbyte) { int rv; @@ -241,6 +251,19 @@ } /* the lowest level writing primitive */ +static int ap_write(BUFF *fb, const void *buf, int nbyte) +{ + int rv; + +#if defined (B_SFIO) + rv = sfwrite(fb->sf_out, buf, nbyte); +#else + rv = write(fb->fd, buf, nbyte); +#endif + + return rv; +} + static ap_inline int buff_write(BUFF *fb, const void *buf, int nbyte) { int rv;