[Webkit-unassigned] [Bug 23116] [GTK] Fix crash due a callback called from GIO after the destruction of the ResourceHandle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 11 08:27:11 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=23116





------- Comment #15 from zecke at selfish.org  2009-01-11 08:27 PDT -------
(From update of attachment 26577)
> commit 675d7e669ec7147a4f6c1d0972574b4ffe441f6b
> Author: Benjamin Otte <otte at gnome.org>
> Date:   Thu Jan 8 22:26:33 2009 +0100
> 
>     [SOUP] bug 23116, part 2

like in the previous bug, extra points if you could create a proper description
here. Now I would have to do git commit --amend after taking your patch, or go
though svn-apply..



> +        Also included is a crash fix for when a file:// url is a directory.


Hmm, we talked about this didn't we? One patch per issue... So far I see a GIO
crash from the callback and you see a second crash, split it up.


>  ResourceHandle::~ResourceHandle()
>  {
> +    cancel();
>  }

This is creating a interesting question. If cancel was already called and we
call cancel again nothing will happen. If it was not called before we will
invoke call the ResourceHandleClient. This is something that this backend was
not doing before and at least Qt is not doing that. I would prefer to not
change the behavior without a good reason. 


>  static void fillResponseFromMessage(SoupMessage* msg, ResourceResponse* response)
>  {
>      SoupMessageHeadersIter iter;
> -    const char* name = NULL;
> -    const char* value = NULL;
> +    const char* name = 0;
> +    const char* value = 0;

Okay, unrelated cleanup :)


>  static void restartedCallback(SoupMessage* msg, gpointer data)
>  {
>      ResourceHandle* handle = static_cast<ResourceHandle*>(data);
> -    if (!handle)
> -        return;

unrelated cleanup...

Handle* handle = static_cast<ResourceHandle*>(data);
> -    if (!handle)
> -        return;

unrelated cleanup


>      if (SOUP_STATUS_IS_TRANSPORT_ERROR(msg->status_code)) {
>          char* uri = soup_uri_to_string(soup_message_get_uri(msg), FALSE);
>          ResourceError error("webkit-network-error", ERROR_TRANSPORT, uri, String::fromUTF8(msg->reason_phrase));
>          g_free(uri);
> +        g_object_unref(d->m_msg);
> +        d->m_msg = 0;

unrelated...



> +        SoupMessage *msg = d->m_msg;

style

....

smaller patches (one patch per issue) would be so much easier to review. The
only reason for a big patch doing more than one thing is a rewrite because
something is inherently wrong with the current implementation...


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list