Hi Mohamed,

> > > diff --git a/gweb/gweb.c b/gweb/gweb.c
> > > index a348cdd..2533a3a 100644
> > > --- a/gweb/gweb.c
> > > +++ b/gweb/gweb.c
> > > @@ -402,7 +402,8 @@ static gboolean process_send_buffer(struct 
> > > web_session *session)
> > >   if (status != G_IO_STATUS_NORMAL && status != G_IO_STATUS_AGAIN)
> > >           return FALSE;
> > >  
> > > - g_string_erase(buf, 0, bytes_written);
> > > + if (status == G_IO_STATUS_NORMAL)
> > > +         g_string_erase(buf, 0, bytes_written);
> > >  
> > >   return TRUE;
> > >  }
> > 
> > I was going to apply this patch, but what is actually wrong with this
> > one? So bytes_writen return the actual written bytes and it can happen
> > that we have have written some. The number bytes we have written should
> > be erased Independent from the return value, right?
> > 
> I thought about it but since we never check that before i thought it
> will never happen, but since you brought it up I can resend the patch
> with checking bytes_writen.

that is not what I meant. So in case of STATUS_AGAIN, the bytes_written
value will still be set. It just might be zero all the time, the
string_erase becomes still a no-op.

Have you seen issues with this code actually? Since I think it is doing
exactly the right thing, no matter what.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to