dgaudet 99/04/20 10:51:40
Modified: src CHANGES
src/include ap_mmn.h http_protocol.h
src/main http_protocol.c
Log:
Add ap_vrprintf() function
PR: 4246
Submitted by: John Tobey <[EMAIL PROTECTED]>
Revision Changes Path
1.1311 +2 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1310
retrieving revision 1.1311
diff -u -r1.1310 -r1.1311
--- CHANGES 1999/04/20 17:27:47 1.1310
+++ CHANGES 1999/04/20 17:51:35 1.1311
@@ -1,5 +1,7 @@
Changes with Apache 1.3.7
+ *) Add ap_vrprintf() function. [John Tobey <[EMAIL PROTECTED]>] PR#4246
+
*) Fix the mod_mime hash table to work properly with locales other
than C. [Dean Gaudet] PR#3427
1.33 +2 -1 apache-1.3/src/include/ap_mmn.h
Index: ap_mmn.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ap_mmn.h 1999/03/20 23:43:23 1.32
+++ ap_mmn.h 1999/04/20 17:51:37 1.33
@@ -214,6 +214,7 @@
* 19990108.6 - SIGPIPE is now ignored by the core server.
* 19990108.7 - ap_isxdigit added
* 19990320 - METHODS and M_INVALID symbol values modified
+ * 19990320.1 - add ap_vrprintf()
*/
#define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
@@ -221,7 +222,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 19990320
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
#define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR /* backward
compat */
/* Useful for testing for features. */
1.49 +1 -0 apache-1.3/src/include/http_protocol.h
Index: http_protocol.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/http_protocol.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- http_protocol.h 1999/01/01 19:04:40 1.48
+++ http_protocol.h 1999/04/20 17:51:37 1.49
@@ -148,6 +148,7 @@
API_EXPORT(int) ap_rputs(const char *str, request_rec *r);
API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r);
API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r,...);
+API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list vlist);
API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...)
__attribute__((format(printf,2,3)));
API_EXPORT(int) ap_rflush(request_rec *r);
1.262 +22 -0 apache-1.3/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
retrieving revision 1.261
retrieving revision 1.262
diff -u -r1.261 -r1.262
--- http_protocol.c 1999/03/10 17:42:42 1.261
+++ http_protocol.c 1999/04/20 17:51:38 1.262
@@ -2173,6 +2173,28 @@
return n;
}
+API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list ap)
+{
+ int n;
+
+ if (r->connection->aborted)
+ return -1;
+
+ n = ap_vbprintf(r->connection->client, fmt, ap);
+
+ if (n < 0) {
+ if (!r->connection->aborted) {
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, r,
+ "client stopped connection before vrprintf completed");
+ ap_bsetflag(r->connection->client, B_EOUT, 1);
+ r->connection->aborted = 1;
+ }
+ return -1;
+ }
+ SET_BYTES_SENT(r);
+ return n;
+}
+
API_EXPORT(int) ap_rprintf(request_rec *r, const char *fmt,...)
{
va_list vlist;