return false from dispatch () if the read and write sockets have been
unset in tunnel_complete ()
Setting up HTTP tunnels causes segfaults since the watch for the second
connection is not destroyed anymore in tunnel_complete () and the connection
will still be used even though it is not valid anymore.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686276
/* in the callback the connection should be tunneled with the
* GET connection */
- if (watch->funcs.tunnel_complete)
+ if (watch->funcs.tunnel_complete) {
watch->funcs.tunnel_complete (watch, watch->user_data);
+ keep_running = !(watch->conn->read_socket == NULL &&
+ watch->conn->write_socket == NULL);
+ if (!keep_running)
+ goto done;
+ }
goto read_done;
}
}
g_mutex_unlock (&watch->mutex);
}
+done:
write_blocked:
return keep_running;