Hi,
In the httpd there is #define HTTP_VERSION (me be clever ;).
Well, there is also diferent define in the wininet.h with the same name.
Can we rename that define to AP_HTTP_VERSION like in the apache 1.3.x?
Since this affects only us poor win developers hope that others wouldn't
mind.
MT.
Index: httpd.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/include/httpd.h,v
retrieving revision 1.200
diff -u -r1.200 httpd.h
--- httpd.h 24 Oct 2003 16:20:27 -0000 1.200
+++ httpd.h 2 Nov 2003 10:24:28 -0000
@@ -278,7 +278,7 @@
/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */
-#define HTTP_VERSION(major,minor) (1000*(major)+(minor))
+#define AP_HTTP_VERSION(major,minor) (1000*(major)+(minor))
/** Major part of HTTP protocol */
#define HTTP_VERSION_MAJOR(number) ((number)/1000)
/** Minor part of HTTP protocol */
Index: protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/protocol.c,v
retrieving revision 1.138
diff -u -r1.138 protocol.c
--- protocol.c 22 Oct 2003 16:45:53 -0000 1.138
+++ protocol.c 2 Nov 2003 10:25:27 -0000
@@ -662,7 +662,7 @@
*/
if (len > (apr_size_t)r->server->limit_req_line) {
r->status = HTTP_REQUEST_URI_TOO_LARGE;
- r->proto_num = HTTP_VERSION(1,0);
+ r->proto_num = AP_HTTP_VERSION(1,0);
r->protocol = apr_pstrdup(r->pool, "HTTP/1.0");
return 0;
}
@@ -685,14 +685,14 @@
&& pro[0] == 'H' && pro[1] == 'T' && pro[2] == 'T' && pro[3] == 'P'
&& pro[4] == '/' && apr_isdigit(pro[5]) && pro[6] == '.'
&& apr_isdigit(pro[7])) {
- r->proto_num = HTTP_VERSION(pro[5] - '0', pro[7] - '0');
+ r->proto_num = AP_HTTP_VERSION(pro[5] - '0', pro[7] - '0');
}
else if (3 == sscanf(r->protocol, "%4s/%u.%u", http, &major, &minor)
&& (strcasecmp("http", http) == 0)
- && (minor < HTTP_VERSION(1, 0)) ) /* don't allow HTTP/0.1000 */
- r->proto_num = HTTP_VERSION(major, minor);
+ && (minor < AP_HTTP_VERSION(1, 0)) ) /* don't allow HTTP/0.1000 */
+ r->proto_num = AP_HTTP_VERSION(major, minor);
else
- r->proto_num = HTTP_VERSION(1, 0);
+ r->proto_num = AP_HTTP_VERSION(1, 0);
return 1;
}
@@ -956,8 +956,8 @@
/* we may have switched to another server */
r->per_dir_config = r->server->lookup_defaults;
- if ((!r->hostname && (r->proto_num >= HTTP_VERSION(1, 1)))
- || ((r->proto_num == HTTP_VERSION(1, 1))
+ if ((!r->hostname && (r->proto_num >= AP_HTTP_VERSION(1, 1)))
+ || ((r->proto_num == AP_HTTP_VERSION(1, 1))
&& !apr_table_get(r->headers_in, "Host"))) {
/*
* Client sent us an HTTP/1.1 or later request without telling us the
Index: http_protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/http_protocol.c,v
retrieving revision 1.471
diff -u -r1.471 http_protocol.c
--- http_protocol.c 31 Aug 2003 16:14:39 -0000 1.471
+++ http_protocol.c 2 Nov 2003 10:26:12 -0000
@@ -237,7 +237,7 @@
apr_table_get(r->headers_out,
"Transfer-Encoding"),
"chunked")
- || ((r->proto_num >= HTTP_VERSION(1,1))
+ || ((r->proto_num >= AP_HTTP_VERSION(1,1))
&& (r->chunked = 1))) /* THIS CODE IS CORRECT, see above. */
&& r->server->keep_alive
&& (r->server->keep_alive_timeout > 0)
@@ -249,7 +249,7 @@
&& (!apr_table_get(r->subprocess_env, "nokeepalive")
|| apr_table_get(r->headers_in, "Via"))
&& ((ka_sent = ap_find_token(r->pool, conn, "keep-alive"))
- || (r->proto_num >= HTTP_VERSION(1,1)))) {
+ || (r->proto_num >= AP_HTTP_VERSION(1,1)))) {
int left = r->server->keep_alive_max - r->connection->keepalives;
r->connection->keepalive = AP_CONN_KEEPALIVE;
@@ -876,7 +876,7 @@
* Only valid on chunked and C-L bodies where the C-L is > 0. */
if ((ctx->state == BODY_CHUNK ||
(ctx->state == BODY_LENGTH && ctx->remaining > 0)) &&
- f->r->expecting_100 && f->r->proto_num >= HTTP_VERSION(1,1)) {
+ f->r->expecting_100 && f->r->proto_num >= AP_HTTP_VERSION(1,1)) {
char *tmp;
apr_bucket_brigade *bb;
@@ -1238,14 +1238,14 @@
}
/* Note that we must downgrade before checking for force responses. */
- if (r->proto_num > HTTP_VERSION(1,0)
+ if (r->proto_num > AP_HTTP_VERSION(1,0)
&& apr_table_get(r->subprocess_env, "downgrade-1.0")) {
- r->proto_num = HTTP_VERSION(1,0);
+ r->proto_num = AP_HTTP_VERSION(1,0);
}
/* kludge around broken browsers when indicated by force-response-1.0
*/
- if (r->proto_num == HTTP_VERSION(1,0)
+ if (r->proto_num == AP_HTTP_VERSION(1,0)
&& apr_table_get(r->subprocess_env, "force-response-1.0")) {
*protocol = "HTTP/1.0";
r->connection->keepalive = AP_CONN_CLOSE;
@@ -1618,7 +1618,7 @@
*/
if (apr_table_get(r->subprocess_env, "force-no-vary") != NULL) {
apr_table_unset(r->headers_out, "Vary");
- r->proto_num = HTTP_VERSION(1,0);
+ r->proto_num = AP_HTTP_VERSION(1,0);
apr_table_set(r->subprocess_env, "force-response-1.0", "1");
}
else {
Index: proxy_http.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/proxy/proxy_http.c,v
retrieving revision 1.172
diff -u -r1.172 proxy_http.c
--- proxy_http.c 22 Oct 2003 16:09:58 -0000 1.172
+++ proxy_http.c 2 Nov 2003 10:27:17 -0000
@@ -1106,7 +1106,7 @@
/* if the connection is < HTTP/1.1, or Connection: close,
* we close the socket, otherwise we leave it open for KeepAlive support
*/
- if (p_conn->close || (r->proto_num < HTTP_VERSION(1,1))) {
+ if (p_conn->close || (r->proto_num < AP_HTTP_VERSION(1,1))) {
if (p_conn->sock) {
apr_socket_close(p_conn->sock);
p_conn->sock = NULL;