Author: joes
Date: Sun Mar 13 09:14:04 2005
New Revision: 157344
URL: http://svn.apache.org/viewcvs?view=rev&rev=157344
Log:
As reported by Max Kellermann, APR_EGENERAL doesn't
have an apr_strerror in 2.0.53, so it's not portable
across the platforms we try to support. This patch
basically s/APR_EGENERAL/APREQ_ERROR_GENERAL/g;
we still need to find a way for mod_apreq to put proper
apreq error messages in the server log.
Note: This patch should complete r157332, which only patched library/t/error.c.
Modified:
httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
httpd/apreq/branches/multi-env-unstable/include/apreq_module.h
httpd/apreq/branches/multi-env-unstable/include/apreq_parser.h
httpd/apreq/branches/multi-env-unstable/library/cookie.c
httpd/apreq/branches/multi-env-unstable/library/module_cgi.c
httpd/apreq/branches/multi-env-unstable/library/parser.c
httpd/apreq/branches/multi-env-unstable/library/parser_header.c
httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c
httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c
httpd/apreq/branches/multi-env-unstable/library/t/parsers.c
httpd/apreq/branches/multi-env-unstable/module/apache/command.c
httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c
Modified:
httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/Apache/Request/Apache__Request.h?view=diff&r1=157343&r2=157344
==============================================================================
---
httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
(original)
+++
httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
Sun Mar 13 09:14:04 2005
@@ -233,7 +233,7 @@
if (SvTRUE(ERRSV)) {
Perl_warn(aTHX_ "Upload hook failed: %s", SvPV_nolen(ERRSV));
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
return APR_SUCCESS;
}
Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_module.h
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq_module.h?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq_module.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq_module.h Sun Mar 13
09:14:04 2005
@@ -433,12 +433,12 @@
args_status = apreq_args(req, &dummy);
body_status = apreq_body(req, &dummy);
- /* XXX: punt to APR_EGENERAL; need to improve this
+ /* XXX: punt to APREQ_ERROR_GENERAL; need to improve this
* for valid requests where certain data/headers are
* unavailable.
*/
if (jar_status || args_status || body_status)
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
return APR_SUCCESS;
}
Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_parser.h
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/include/apreq_parser.h?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/include/apreq_parser.h (original)
+++ httpd/apreq/branches/multi-env-unstable/include/apreq_parser.h Sun Mar 13
09:14:04 2005
@@ -254,7 +254,7 @@
/**
- * Returns APR_EGENERAL. Effectively disables mfd parser
+ * Returns APREQ_ERROR_GENERAL. Effectively disables mfd parser
* if a file-upload field is present.
*
*/
Modified: httpd/apreq/branches/multi-env-unstable/library/cookie.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/cookie.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/cookie.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/cookie.c Sun Mar 13
09:14:04 2005
@@ -362,7 +362,7 @@
}
/* NOT REACHED */
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
Modified: httpd/apreq/branches/multi-env-unstable/library/module_cgi.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/module_cgi.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/module_cgi.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/module_cgi.c Sun Mar 13
09:14:04 2005
@@ -65,15 +65,6 @@
#define CRLF "\015\012"
-#define APREQ_ENV_STATUS(rc_run, k) do { \
- apr_status_t rc = rc_run; \
- if (rc != APR_SUCCESS) { \
- apreq_log(APREQ_DEBUG APR_EGENERAL, env, \
- "Lookup of %s failed: status=%d", k, rc); \
- } \
- } while (0)
-
-
typedef struct {
const char *t_name;
int t_val;
@@ -182,7 +173,7 @@
"Setting header: %s => %s", name, value);
bytes = apr_file_printf(out, "%s: %s" CRLF, name, value);
apr_file_flush(out);
- return bytes > 0 ? APR_SUCCESS : APR_EGENERAL;
+ return bytes > 0 ? APR_SUCCESS : APREQ_ERROR_GENERAL;
}
Modified: httpd/apreq/branches/multi-env-unstable/library/parser.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser.c Sun Mar 13
09:14:04 2005
@@ -14,6 +14,7 @@
** limitations under the License.
*/
+#include "apreq_error.h"
#include "apreq_parser.h"
#include "apreq_util.h"
#include "apr_strings.h"
@@ -23,7 +24,7 @@
#define PARSER_STATUS_CHECK(PREFIX) do { \
if (ctx->status == PREFIX##_ERROR) \
- return APR_EGENERAL; \
+ return APREQ_ERROR_GENERAL; \
else if (ctx->status == PREFIX##_COMPLETE) \
return APR_SUCCESS; \
else if (bb == NULL) \
@@ -97,7 +98,7 @@
apr_status_t status;
if (default_parser_pool != NULL)
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
status = apr_pool_create(&default_parser_pool, pool);
if (status != APR_SUCCESS)
@@ -182,7 +183,7 @@
APREQ_DECLARE_HOOK(apreq_hook_disable_uploads)
{
- return (bb == NULL) ? APR_SUCCESS : APR_EGENERAL;
+ return (bb == NULL) ? APR_SUCCESS : APREQ_ERROR_GENERAL;
}
APREQ_DECLARE_HOOK(apreq_hook_discard_brigade)
Modified: httpd/apreq/branches/multi-env-unstable/library/parser_header.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_header.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_header.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_header.c Sun Mar 13
09:14:04 2005
@@ -20,7 +20,7 @@
#define PARSER_STATUS_CHECK(PREFIX) do { \
if (ctx->status == PREFIX##_ERROR) \
- return APR_EGENERAL; \
+ return APREQ_ERROR_GENERAL; \
else if (ctx->status == PREFIX##_COMPLETE) \
return APR_SUCCESS; \
else if (bb == NULL) \
Modified: httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c
(original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_multipart.c Sun Mar
13 09:14:04 2005
@@ -28,7 +28,7 @@
#define PARSER_STATUS_CHECK(PREFIX) do { \
if (ctx->status == PREFIX##_ERROR) \
- return APR_EGENERAL; \
+ return APREQ_ERROR_GENERAL; \
else if (ctx->status == PREFIX##_COMPLETE) \
return APR_SUCCESS; \
else if (bb == NULL) \
@@ -95,7 +95,7 @@
bytes_to_check = MIN(slen,blen);
if (strncmp(buf,start_string,bytes_to_check) != 0)
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
slen -= bytes_to_check;
start_string += bytes_to_check;
@@ -258,7 +258,7 @@
parser->brigade_limit,
parser->temp_dir);
if (ctx == NULL)
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
ctx->mix_parser = apreq_parser_make(pool, ba, "",
@@ -384,7 +384,7 @@
s = apreq_header_attribute(cd, "name", 4, &name, &nlen);
if (s != APR_SUCCESS) {
ctx->status = MFD_ERROR;
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
s = apreq_header_attribute(cd, "filename",
@@ -401,7 +401,7 @@
parser->temp_dir);
if (mix_ctx == NULL) {
ctx->status = MFD_ERROR;
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
mix_ctx->param_name = apr_pstrmemdup(pool,
@@ -457,7 +457,7 @@
cd = apr_table_get(ctx->info, "Content-ID");
if (cd == NULL) {
ctx->status = MFD_ERROR;
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
name = cd;
nlen = strlen(name);
@@ -602,7 +602,7 @@
break; /* not reached */
default:
- return APR_EGENERAL;
+ return APREQ_ERROR_GENERAL;
}
return APR_INCOMPLETE;
Modified: httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c
(original)
+++ httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c Sun Mar
13 09:14:04 2005
@@ -21,7 +21,7 @@
#define PARSER_STATUS_CHECK(PREFIX) do { \
if (ctx->status == PREFIX##_ERROR) \
- return APR_EGENERAL; \
+ return APREQ_ERROR_GENERAL; \
else if (ctx->status == PREFIX##_COMPLETE) \
return APR_SUCCESS; \
else if (bb == NULL) \
Modified: httpd/apreq/branches/multi-env-unstable/library/t/parsers.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/parsers.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/parsers.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/parsers.c Sun Mar 13
09:14:04 2005
@@ -278,7 +278,7 @@
rv = apreq_parser_run(parser, body, bb);
- AT_int_eq(rv, APR_EGENERAL);
+ AT_int_eq(rv, APREQ_ERROR_GENERAL);
AT_int_eq(apr_table_elts(body)->nelts, 1);
val = apr_table_get(body,"field1");
Modified: httpd/apreq/branches/multi-env-unstable/module/apache/command.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache/command.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache/command.c (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache/command.c Sun Mar 13
09:14:04 2005
@@ -33,7 +33,7 @@
* <TR class="odd"><TD>APREQ_ReadLimit</TD><TD>directory</TD><TD>-1
(Unlimited)</TD><TD>
* Maximum number of bytes mod_apreq will send off to libapreq for parsing.
* mod_apreq will log this event and remove itself from the filter chain.
- * The APR_EGENERAL error will be reported to libapreq2 users via the return
+ * The APREQ_ERROR_GENERAL error will be reported to libapreq2 users via the
return
* value of apreq_env_read().
* </TD></TR>
* <TR><TD>APREQ_BrigadeLimit</TD><TD>directory</TD><TD>
#APREQ_MAX_BRIGADE_LEN </TD><TD>
Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c?view=diff&r1=157343&r2=157344
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c Sun Mar 13
09:14:04 2005
@@ -93,7 +93,7 @@
* <TR class="odd"><TD>APREQ_ReadLimit</TD><TD>directory</TD><TD>-1
(Unlimited)</TD><TD>
* Maximum number of bytes mod_apreq will send off to libapreq for parsing.
* mod_apreq will log this event and remove itself from the filter chain.
- * The APR_EGENERAL error will be reported to libapreq2 users via the return
+ * The APREQ_ERROR_GENERAL error will be reported to libapreq2 users via the
return
* value of apreq_env_read().
* </TD></TR>
* <TR><TD>APREQ_BrigadeLimit</TD><TD>directory</TD><TD>
#APREQ_MAX_BRIGADE_LEN </TD><TD>