mfavant / tubekit

NEW PROJECT https://github.com/crust-hub/avant
MIT License
0 stars 0 forks source link

bug: Issues that need to be investigated for buffer #2

Closed gaowanlu closed 1 year ago

gaowanlu commented 1 year ago

On HTTP A buffer was used in the request, but when the 1024 in the buffer's constructor is changed to 10, there may be inexplicably strange problems, which may also be related to HTTP Issues related to the processing flow in the task

NOW

buffer::buffer(u_int64_t limit_max)
{
    m_size = limit_max < 1024 ? limit_max : 1024;
    m_limit_max = limit_max;
    m_buffer = nullptr;
    m_buffer = (char *)malloc(m_size);
    m_read_ptr = m_buffer;
    m_write_ptr = m_buffer;
    m_last_read = time(nullptr);
    m_last_write = time(nullptr);
}

BUG Code

buffer::buffer(u_int64_t limit_max)
{
    m_size = limit_max < 10 ? limit_max : 10;
    m_limit_max = limit_max;
    m_buffer = nullptr;
    m_buffer = (char *)malloc(m_size);
    m_read_ptr = m_buffer;
    m_write_ptr = m_buffer;
    m_last_read = time(nullptr);
    m_last_write = time(nullptr);
}