You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Ed Slattery (JIRA)" <ji...@apache.org> on 2006/01/30 15:23:32 UTC

[jira] Created: (AXIS2C-43) Buffer growth not working in guththila

Buffer growth not working in guththila
--------------------------------------

         Key: AXIS2C-43
         URL: http://issues.apache.org/jira/browse/AXIS2C-43
     Project: Axis2-C
        Type: Bug
  Components: Pull Parser - Guththila  
 Environment: windows
    Reporter: Ed Slattery
    Priority: Minor


I am not sure the current buffer growth in guththila is really growing the buffer. It appears to me
to be growing the structure containing the buffer, but leaving the buffer at its original size.
I also think the call to the growth routine may be reversing the new and old offsets such that the final
offset if negative. Here are patches which I think are necessary.

from guththila_xml_pull_parser.c...


GUTHTHILA_DECLARE (int)
guththila_xml_pull_parser_read (guththila_environment_t * environment,
                                guththila_xml_pull_parser_t * parser)
{
    int c = 0;
    if (parser->_next == parser->buffer->size)
    {
        if (parser->offset > 0)
        {
            guththila_xml_pull_parser_relocate_tokens (environment, parser,
                                                       parser->offset);
            guththila_xml_pull_parser_shift (environment, parser);
        }
        else
        {
            /*- guththila_buffer_t *b = NULL;
                b = parser->buffer; */
            /*+*/ int b = parser->buffer->size;
            parser->buffer =
                guththila_buffer_grow (environment, parser->buffer);
            /*- guththila_xml_pull_parser_relocate_tokens (
                environment, parser, (b->size - parser->buffer->size));*/
            /*+*/guththila_xml_pull_parser_relocate_tokens (
            /*+*/  environment, parser, (parser->buffer->size - b));
        }
    }
    c = guththila_reader_read (environment, (parser->buffer->buff),
                               (parser->_next),
                               (parser->buffer->size) - (parser->_next),
                               parser->reader);
    parser->last += c;
    return !c;
}



from guththila_buffer.c...

GUTHTHILA_DECLARE (guththila_buffer_t *)
guththila_buffer_grow (guththila_environment_t * environment,
                       guththila_buffer_t * name)
{

    /*+*/guththila_char_t *x = NULL;
    /*-  guththila_buffer_t *x = NULL; */
    name->size <<= 1;
    /*+*/x = (guththila_char_t *) GUTHTHILA_REALLOC (environment->allocator,
    /*+*/                                              name->buff,name->size);
    /*-  x = (guththila_buffer_t *) GUTHTHILA_REALLOC (environment->allocator,
                                                      name, name->size); */
    if (x)
        /*-  name = x;*/
        /*+*/name->buff = x;
    else
        /*- return NULL;*/
        /*+*/name->size >>= 1;
    return name;
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (AXIS2C-43) Buffer growth not working in guththila

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-43?page=all ]

Samisa Abeysinghe reassigned AXIS2C-43:
---------------------------------------

    Assignee: Dinesh Premalal

> Buffer growth not working in guththila
> --------------------------------------
>
>                 Key: AXIS2C-43
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-43
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: guththila
>         Environment: windows
>            Reporter: Ed Slattery
>         Assigned To: Dinesh Premalal
>            Priority: Minor
>
> I am not sure the current buffer growth in guththila is really growing the buffer. It appears to me
> to be growing the structure containing the buffer, but leaving the buffer at its original size.
> I also think the call to the growth routine may be reversing the new and old offsets such that the final
> offset if negative. Here are patches which I think are necessary.
> from guththila_xml_pull_parser.c...
> GUTHTHILA_DECLARE (int)
> guththila_xml_pull_parser_read (guththila_environment_t * environment,
>                                 guththila_xml_pull_parser_t * parser)
> {
>     int c = 0;
>     if (parser->_next == parser->buffer->size)
>     {
>         if (parser->offset > 0)
>         {
>             guththila_xml_pull_parser_relocate_tokens (environment, parser,
>                                                        parser->offset);
>             guththila_xml_pull_parser_shift (environment, parser);
>         }
>         else
>         {
>             /*- guththila_buffer_t *b = NULL;
>                 b = parser->buffer; */
>             /*+*/ int b = parser->buffer->size;
>             parser->buffer =
>                 guththila_buffer_grow (environment, parser->buffer);
>             /*- guththila_xml_pull_parser_relocate_tokens (
>                 environment, parser, (b->size - parser->buffer->size));*/
>             /*+*/guththila_xml_pull_parser_relocate_tokens (
>             /*+*/  environment, parser, (parser->buffer->size - b));
>         }
>     }
>     c = guththila_reader_read (environment, (parser->buffer->buff),
>                                (parser->_next),
>                                (parser->buffer->size) - (parser->_next),
>                                parser->reader);
>     parser->last += c;
>     return !c;
> }
> from guththila_buffer.c...
> GUTHTHILA_DECLARE (guththila_buffer_t *)
> guththila_buffer_grow (guththila_environment_t * environment,
>                        guththila_buffer_t * name)
> {
>     /*+*/guththila_char_t *x = NULL;
>     /*-  guththila_buffer_t *x = NULL; */
>     name->size <<= 1;
>     /*+*/x = (guththila_char_t *) GUTHTHILA_REALLOC (environment->allocator,
>     /*+*/                                              name->buff,name->size);
>     /*-  x = (guththila_buffer_t *) GUTHTHILA_REALLOC (environment->allocator,
>                                                       name, name->size); */
>     if (x)
>         /*-  name = x;*/
>         /*+*/name->buff = x;
>     else
>         /*- return NULL;*/
>         /*+*/name->size >>= 1;
>     return name;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-43) Buffer growth not working in guththila

Posted by "Ed Slattery (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2C-43?page=comments#action_12364463 ] 

Ed Slattery commented on AXIS2C-43:
-----------------------------------

possibly related to AXISCPP-827?

> Buffer growth not working in guththila
> --------------------------------------
>
>          Key: AXIS2C-43
>          URL: http://issues.apache.org/jira/browse/AXIS2C-43
>      Project: Axis2-C
>         Type: Bug
>   Components: Pull Parser - Guththila
>  Environment: windows
>     Reporter: Ed Slattery
>     Priority: Minor

>
> I am not sure the current buffer growth in guththila is really growing the buffer. It appears to me
> to be growing the structure containing the buffer, but leaving the buffer at its original size.
> I also think the call to the growth routine may be reversing the new and old offsets such that the final
> offset if negative. Here are patches which I think are necessary.
> from guththila_xml_pull_parser.c...
> GUTHTHILA_DECLARE (int)
> guththila_xml_pull_parser_read (guththila_environment_t * environment,
>                                 guththila_xml_pull_parser_t * parser)
> {
>     int c = 0;
>     if (parser->_next == parser->buffer->size)
>     {
>         if (parser->offset > 0)
>         {
>             guththila_xml_pull_parser_relocate_tokens (environment, parser,
>                                                        parser->offset);
>             guththila_xml_pull_parser_shift (environment, parser);
>         }
>         else
>         {
>             /*- guththila_buffer_t *b = NULL;
>                 b = parser->buffer; */
>             /*+*/ int b = parser->buffer->size;
>             parser->buffer =
>                 guththila_buffer_grow (environment, parser->buffer);
>             /*- guththila_xml_pull_parser_relocate_tokens (
>                 environment, parser, (b->size - parser->buffer->size));*/
>             /*+*/guththila_xml_pull_parser_relocate_tokens (
>             /*+*/  environment, parser, (parser->buffer->size - b));
>         }
>     }
>     c = guththila_reader_read (environment, (parser->buffer->buff),
>                                (parser->_next),
>                                (parser->buffer->size) - (parser->_next),
>                                parser->reader);
>     parser->last += c;
>     return !c;
> }
> from guththila_buffer.c...
> GUTHTHILA_DECLARE (guththila_buffer_t *)
> guththila_buffer_grow (guththila_environment_t * environment,
>                        guththila_buffer_t * name)
> {
>     /*+*/guththila_char_t *x = NULL;
>     /*-  guththila_buffer_t *x = NULL; */
>     name->size <<= 1;
>     /*+*/x = (guththila_char_t *) GUTHTHILA_REALLOC (environment->allocator,
>     /*+*/                                              name->buff,name->size);
>     /*-  x = (guththila_buffer_t *) GUTHTHILA_REALLOC (environment->allocator,
>                                                       name, name->size); */
>     if (x)
>         /*-  name = x;*/
>         /*+*/name->buff = x;
>     else
>         /*- return NULL;*/
>         /*+*/name->size >>= 1;
>     return name;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (AXIS2C-43) Buffer growth not working in guththila

Posted by "Dinesh Premalal (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-43?page=all ]

Dinesh Premalal closed AXIS2C-43.
---------------------------------

    Fix Version/s: Current (Nightly)
       Resolution: Fixed

> Buffer growth not working in guththila
> --------------------------------------
>
>                 Key: AXIS2C-43
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-43
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: guththila
>         Environment: windows
>            Reporter: Ed Slattery
>         Assigned To: Dinesh Premalal
>            Priority: Minor
>             Fix For: Current (Nightly)
>
>
> I am not sure the current buffer growth in guththila is really growing the buffer. It appears to me
> to be growing the structure containing the buffer, but leaving the buffer at its original size.
> I also think the call to the growth routine may be reversing the new and old offsets such that the final
> offset if negative. Here are patches which I think are necessary.
> from guththila_xml_pull_parser.c...
> GUTHTHILA_DECLARE (int)
> guththila_xml_pull_parser_read (guththila_environment_t * environment,
>                                 guththila_xml_pull_parser_t * parser)
> {
>     int c = 0;
>     if (parser->_next == parser->buffer->size)
>     {
>         if (parser->offset > 0)
>         {
>             guththila_xml_pull_parser_relocate_tokens (environment, parser,
>                                                        parser->offset);
>             guththila_xml_pull_parser_shift (environment, parser);
>         }
>         else
>         {
>             /*- guththila_buffer_t *b = NULL;
>                 b = parser->buffer; */
>             /*+*/ int b = parser->buffer->size;
>             parser->buffer =
>                 guththila_buffer_grow (environment, parser->buffer);
>             /*- guththila_xml_pull_parser_relocate_tokens (
>                 environment, parser, (b->size - parser->buffer->size));*/
>             /*+*/guththila_xml_pull_parser_relocate_tokens (
>             /*+*/  environment, parser, (parser->buffer->size - b));
>         }
>     }
>     c = guththila_reader_read (environment, (parser->buffer->buff),
>                                (parser->_next),
>                                (parser->buffer->size) - (parser->_next),
>                                parser->reader);
>     parser->last += c;
>     return !c;
> }
> from guththila_buffer.c...
> GUTHTHILA_DECLARE (guththila_buffer_t *)
> guththila_buffer_grow (guththila_environment_t * environment,
>                        guththila_buffer_t * name)
> {
>     /*+*/guththila_char_t *x = NULL;
>     /*-  guththila_buffer_t *x = NULL; */
>     name->size <<= 1;
>     /*+*/x = (guththila_char_t *) GUTHTHILA_REALLOC (environment->allocator,
>     /*+*/                                              name->buff,name->size);
>     /*-  x = (guththila_buffer_t *) GUTHTHILA_REALLOC (environment->allocator,
>                                                       name, name->size); */
>     if (x)
>         /*-  name = x;*/
>         /*+*/name->buff = x;
>     else
>         /*- return NULL;*/
>         /*+*/name->size >>= 1;
>     return name;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-43) Buffer growth not working in guththila

Posted by "Ed Slattery (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2C-43?page=comments#action_12365539 ] 

Ed Slattery commented on AXIS2C-43:
-----------------------------------

Applied  a fix for this 

> Buffer growth not working in guththila
> --------------------------------------
>
>          Key: AXIS2C-43
>          URL: http://issues.apache.org/jira/browse/AXIS2C-43
>      Project: Axis2-C
>         Type: Bug
>   Components: Pull Parser - Guththila
>  Environment: windows
>     Reporter: Ed Slattery
>     Priority: Minor

>
> I am not sure the current buffer growth in guththila is really growing the buffer. It appears to me
> to be growing the structure containing the buffer, but leaving the buffer at its original size.
> I also think the call to the growth routine may be reversing the new and old offsets such that the final
> offset if negative. Here are patches which I think are necessary.
> from guththila_xml_pull_parser.c...
> GUTHTHILA_DECLARE (int)
> guththila_xml_pull_parser_read (guththila_environment_t * environment,
>                                 guththila_xml_pull_parser_t * parser)
> {
>     int c = 0;
>     if (parser->_next == parser->buffer->size)
>     {
>         if (parser->offset > 0)
>         {
>             guththila_xml_pull_parser_relocate_tokens (environment, parser,
>                                                        parser->offset);
>             guththila_xml_pull_parser_shift (environment, parser);
>         }
>         else
>         {
>             /*- guththila_buffer_t *b = NULL;
>                 b = parser->buffer; */
>             /*+*/ int b = parser->buffer->size;
>             parser->buffer =
>                 guththila_buffer_grow (environment, parser->buffer);
>             /*- guththila_xml_pull_parser_relocate_tokens (
>                 environment, parser, (b->size - parser->buffer->size));*/
>             /*+*/guththila_xml_pull_parser_relocate_tokens (
>             /*+*/  environment, parser, (parser->buffer->size - b));
>         }
>     }
>     c = guththila_reader_read (environment, (parser->buffer->buff),
>                                (parser->_next),
>                                (parser->buffer->size) - (parser->_next),
>                                parser->reader);
>     parser->last += c;
>     return !c;
> }
> from guththila_buffer.c...
> GUTHTHILA_DECLARE (guththila_buffer_t *)
> guththila_buffer_grow (guththila_environment_t * environment,
>                        guththila_buffer_t * name)
> {
>     /*+*/guththila_char_t *x = NULL;
>     /*-  guththila_buffer_t *x = NULL; */
>     name->size <<= 1;
>     /*+*/x = (guththila_char_t *) GUTHTHILA_REALLOC (environment->allocator,
>     /*+*/                                              name->buff,name->size);
>     /*-  x = (guththila_buffer_t *) GUTHTHILA_REALLOC (environment->allocator,
>                                                       name, name->size); */
>     if (x)
>         /*-  name = x;*/
>         /*+*/name->buff = x;
>     else
>         /*- return NULL;*/
>         /*+*/name->size >>= 1;
>     return name;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira