Skip to content

Commit

Permalink
Fix compiler warnings in fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensmiers committed Jun 19, 2015
1 parent 3d66a00 commit ea9cb64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/pico_fragments.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@ static int first_fragment_received(struct pico_tree *holes)
struct pico_tree_node *idx=NULL, *tmp=NULL;
int retval = PICO_IP_FIRST_FRAG_RECV;

frag_dbg("[LUM:%s:%d] Examine if first fragment was received. \n",__FILE__,__LINE__);

if (holes)
{
pico_tree_foreach_safe(idx, holes, tmp)
Expand Down Expand Up @@ -825,13 +827,11 @@ static int pico_fragment_arrived(pico_fragment_t* fragment, struct pico_frame* f
}
else
{
int addr_diff;

// frame->buffer is too small
// grow frame and copy new recv frame
uint32_t alloc_len= frame->transport_len + fragment->frame->buffer_len;

frag_dbg("[LUM:%s:%d] frame->buffer is too small realloc'd:%p buffer:%p \n",__FILE__,__LINE__,old_buffer,new_buffer );
frag_dbg("[LUM:%s:%d] frame->buffer is too small-> realloc", __FILE__,__LINE__);
frag_dbg("[LUM:%s:%d] frame->buffer original size: %d \n",__FILE__,__LINE__,fragment->frame->buffer_len);
frag_dbg("[LUM:%s:%d] frame->buffer new size: %d \n",__FILE__,__LINE__, alloc_len);
frag_dbg("[LUM:%s:%d] recv frame size: %d \n",__FILE__,__LINE__, frame->buffer_len);
Expand All @@ -844,7 +844,7 @@ static int pico_fragment_arrived(pico_fragment_t* fragment, struct pico_frame* f
/* Copy new frame */
memcpy(fragment->frame->transport_hdr + offset , frame->transport_hdr, frame->transport_len);
/* Update transport len */
fragment->frame->transport_len += frame->transport_len;
fragment->frame->transport_len = (uint16_t)(fragment->frame->transport_len + frame->transport_len);
retval = frame->transport_len;
}
else
Expand Down

0 comments on commit ea9cb64

Please sign in to comment.