Re: [gnet] a gnet_conn_http_run_async () question



On Wednesday 13 April 2005 21:30, David Sowa wrote:

> What's the correct way to tear down the http connection once the callback
> gets GNET_CONN_HTTP_DATA_COMPLETE
>
> I tried to use gnet_conn_http_delete() in the GNET_CONN_HTTP_DATA_COMPLETE
> handler which seemed to crash although that could have been some
> other unrelated bug.
>
> If that is the right way I'll investigate the crash some more,
> otherwise please point me in the right direction.

It's a bug that will have to be fixed. In the mean time you can work around it 
with doing something like this:

gboolean
delete_delayed (GConnHttp *conn)
{
	gnet_conn_http_delete (conn);

	return FALSE; /* don't call us again */
}

.... in your callback ...

   case GNET_CONN_HTTP_DATA_COMPLETE:
      .....
      g_idle_add ((GSourceFunc) delete_delayed, conn);
      ....

Cheers
 -Tim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]