Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Aug 13, 2024
1 parent c4578b3 commit 8ca1734
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tunnels/client/http2/http2_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ static void sendStreamData(http2_client_con_state_t *con, http2_client_child_con
http2FrameHdPack(&framehd, rawBufMut(buf));
context_t *data = newContext(con->line);
data->payload = buf;
con->current_stream_write_line = stream->line;
lockLine(stream->line);

line_t *h2_line = data->line;
// make sure line is not freed, to be able to pause it
lockLine(stream->line);
con->current_stream_write_line = stream->line;
con->tunnel->up->upStream(con->tunnel->up, data);
unLockLine(stream->line);
if (isAlive(h2_line))
Expand Down
7 changes: 4 additions & 3 deletions ww/buffer_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <assert.h> // for assert
#include <stdlib.h>
#include <string.h>

// #define BYPASS_BUFFERPOOL

#define MEMORY_PROFILE_SMALL (RAM_PROFILE >= kRamProfileM1Memory ? kRamProfileM1Memory : RAM_PROFILE)
Expand Down Expand Up @@ -157,7 +158,7 @@ static void shrinkSmallBuffers(buffer_pool_t *pool)
shift_buffer_t *popBuffer(buffer_pool_t *pool)
{
#if defined(DEBUG) && defined(BYPASS_BUFFERPOOL)
return newShiftBuffer(pool->large_buffers_default_size);
return newShiftBuffer(pool->shift_buffer_pool,pool->large_buffers_default_size);
#endif
#if defined(DEBUG) && defined(BUFFER_POOL_DEBUG)
pool->in_use += 1;
Expand All @@ -177,7 +178,7 @@ shift_buffer_t *popBuffer(buffer_pool_t *pool)
shift_buffer_t *popSmallBuffer(buffer_pool_t *pool)
{
#if defined(DEBUG) && defined(BYPASS_BUFFERPOOL)
return newShiftBuffer(pool->small_buffer_size);
return newShiftBuffer(pool->shift_buffer_pool,pool->small_buffers_default_size);
#endif
#if defined(DEBUG) && defined(BUFFER_POOL_DEBUG)
pool->in_use += 1;
Expand All @@ -197,7 +198,7 @@ shift_buffer_t *popSmallBuffer(buffer_pool_t *pool)
void reuseBuffer(buffer_pool_t *pool, shift_buffer_t *b)
{
#if defined(DEBUG) && defined(BYPASS_BUFFERPOOL)
destroyShiftBuffer(b);
destroyShiftBuffer(pool->shift_buffer_pool,b);
return;
#endif

Expand Down
4 changes: 2 additions & 2 deletions ww/context_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#define i_TYPE queue, context_t * // NOLINT
#include "stc/deq.h"

enum
{
kQCap = 16
Expand All @@ -30,8 +31,7 @@ void destroyContextQueue(context_queue_t *self)
{
if ((*i.ref)->payload != NULL)
{
reuseBuffer(getContextBufferPool((*i.ref)), (*i.ref)->payload);
dropContexPayload((*i.ref));
reuseContextPayload(*i.ref);
}
destroyContext((*i.ref));
}
Expand Down

0 comments on commit 8ca1734

Please sign in to comment.