[bug #55702] SSI bug

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #55702] SSI bug

Wilfred
URL:
  <https://savannah.nongnu.org/bugs/?55702>

                 Summary: SSI bug
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: stasgsv
            Submitted on: Вт. 12 февр. 2019 11:13:12
                Category: apps
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: Other

    _______________________________________________________

Details:

LwIP ver 2.1.2
httpd
LWIP_HTTPD_DYNAMIC_FILE_READ = 1
LWIP_HTTPD_SSI_INCLUDE_TAG = 0

if last byte of read buffer is "<" and there are no SSI-tag, then "<" is
lossed.
For example html code consist
...somedata <b>anotherdata...
Read to buffer first time
"...somedata <"
and second time
"b>anotherdata..."
the browser will get
...somedata b>anotherdata...




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55702>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55702] SSI bug

Wilfred
Follow-up Comment #1, bug #55702 (project lwip):

This bug can be fixed by this:

            /* We found an unexpected character so this is not a tag. Move
             * back to idle state. */
            ssi->tag_state = TAG_NONE;
          }

//Add this code
#if LWIP_HTTPD_DYNAMIC_FILE_READ && !LWIP_HTTPD_SSI_INCLUDE_TAG
          if ((ssi->tag_state == TAG_NONE)&&(ssi->parsed - hs->file <
ssi->tag_index)) {
         for(u16_t i = 0;i < ssi->tag_index;i++) {
         ssi->tag_insert[i] = http_ssi_tag_desc[ssi->tag_type].lead_in[i];
         }
                          ssi->tag_insert_len = ssi->tag_index;
                          hs->file += ssi->parsed - hs->file;
                          hs->left -= ssi->parsed - hs->file;
                          ssi->tag_end = hs->file;
                          ssi->tag_index = 0;
                          ssi->tag_state = TAG_SENDING;
                          break;
          }
#endif
          /* Move on to the next character in the buffer */
          ssi->parse_left--;
          ssi->parsed++;


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55702>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55702] SSI bug

Wilfred
Follow-up Comment #2, bug #55702 (project lwip):

Thanks for posting a fix for this. I had the same problem and it was driving
me crazy!


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55702>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #55702] SSI bug

Wilfred
Update of bug #55702 (project lwip):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #3:

Pushed, thanks for the patch!

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55702>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel