[
https://issues.apache.org/jira/browse/AXIS2C-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Lazarski resolved AXIS2C-1509.
-------------------------------------
Fix Version/s: 2.0.0
(was: 1.7.0)
Resolution: Fixed
The issue was that set_char_encoding() stored the encoding on the base struct
(axis2_http_out_transport_info_t) while set_content_type() read it from the
derived struct (axis2_apache2_out_transport_info_t). The fix uses
AXIS2_INTF_TO_IMPL() to convert the pointer before accessing the encoding
field, matching the pattern used by the other functions in the file.
> The response message from axis2/c has not charSet in the
> ContentType(src/core/transport/http/server/apache2/apache2_out_transport_info.c).
> ------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS2C-1509
> URL: https://issues.apache.org/jira/browse/AXIS2C-1509
> Project: Axis2-C
> Issue Type: Bug
> Components: httpd module
> Affects Versions: 1.6.0
> Environment: all environments
> Reporter: zengxianrui-
> Priority: Major
> Fix For: 2.0.0
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> There are two functions in apache2_out_transport_info.c to set the charSet
> ant ContentType of the response message:
> axis2_apache_out_transport_info_set_content_type &
> axis2_apache_out_transport_info_set_char_encoding.
> When you use axis2_apache_out_transport_info_set_char_encoding to set the
> charSet, this function don't converts the input parameter
> axis2_http_out_transport_info_t * info to
> axis2_apache2_out_transport_info_t*, so the encoding is seted to the
> axis2_http_out_transport_info struct. But whe you use
> axis2_apache_out_transport_info_set_content_type to set the ContentType,
> this function converts the input parameter axis2_http_out_transport_info_t *
> out_transport_info to axis2_apache2_out_transport_info_t*, so this function
> use axis2_apache2_out_transport_info struct to get encoding, you know the
> encoding field in this struct is null, so we can't get the correct encoding
> in the response message.
> the two functions are:
> axis2_status_t AXIS2_CALL
> axis2_apache_out_transport_info_set_char_encoding(
> axis2_http_out_transport_info_t * info,
> const axutil_env_t * env,
> const axis2_char_t * encoding)
> {
> AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
> AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
> if (info->encoding)
> {
> AXIS2_FREE(env->allocator, info->encoding);
> }
> info->encoding = axutil_strdup(env, encoding);
> return AXIS2_SUCCESS;
> }
> axis2_status_t AXIS2_CALL
> axis2_apache_out_transport_info_set_content_type(
> axis2_http_out_transport_info_t * out_transport_info,
> const axutil_env_t * env,
> const axis2_char_t * content_type)
> {
> axis2_apache2_out_transport_info_t *info = NULL;
> axis2_char_t *tmp1 = NULL;
> axis2_char_t *tmp2 = NULL;
> AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
> AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
> info = AXIS2_INTF_TO_IMPL(out_transport_info);
> if (info->encoding)
> {
> tmp1 = axutil_stracat(env, content_type, ";charset=");
> tmp2 = axutil_stracat(env, tmp1, info->encoding);
> info->request->content_type = apr_pstrdup(info->request->pool, tmp2);
> AXIS2_FREE(env->allocator, tmp1);
> AXIS2_FREE(env->allocator, tmp2);
> }
> else
> {
> info->request->content_type = apr_pstrdup(info->request->pool,
> content_type);
> }
> return AXIS2_SUCCESS;
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]