summaryrefslogtreecommitdiff
path: root/include/http_protocol.h
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-06-04 18:50:55 +0000
committerStefan Fritsch <sf@apache.org>2011-06-04 18:50:55 +0000
commitcdb37c5e4d684dd22c702a1d8ae65ab875603d40 (patch)
treea0070b2c709991b311284d89603a5e765e2534eb /include/http_protocol.h
parentae7fa449a91c63c7a8c96ee3ab6a242e4ac036bc (diff)
downloadhttpd-cdb37c5e4d684dd22c702a1d8ae65ab875603d40.tar.gz
Make ap_rputs an inline function, as it is mostly used with string constants
and this allows the compiler to optimize the strlen() call away. Submitted by: Christophe Jaillet <christophe jaillet wanadoo fr> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1131465 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_protocol.h')
-rw-r--r--include/http_protocol.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/include/http_protocol.h b/include/http_protocol.h
index 61d33a3949..996e606ef8 100644
--- a/include/http_protocol.h
+++ b/include/http_protocol.h
@@ -319,21 +319,25 @@ AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct);
AP_DECLARE(int) ap_rputc(int c, request_rec *r);
/**
- * Output a string for the current request
- * @param str The string to output
+ * Write a buffer for the current request
+ * @param buf The buffer to write
+ * @param nbyte The number of bytes to send from the buffer
* @param r The current request
* @return The number of bytes sent
*/
-AP_DECLARE(int) ap_rputs(const char *str, request_rec *r);
+AP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r);
/**
- * Write a buffer for the current request
- * @param buf The buffer to write
- * @param nbyte The number of bytes to send from the buffer
+ * Output a string for the current request
+ * @param str The string to output
* @param r The current request
* @return The number of bytes sent
+ * @note ap_rputs may be implemented as macro or inline function
*/
-AP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r);
+static inline int ap_rputs(const char *str, request_rec *r)
+{
+ return ap_rwrite(str, strlen(str), r);
+}
/**
* Write an unspecified number of strings to the request