After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 369338 - Improvements for the get_existing_connection functions
Improvements for the get_existing_connection functions
Status: RESOLVED FIXED
Product: gossip
Classification: Deprecated
Component: Telepathy
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gossip Maintainers
Gossip Maintainers
: 368801 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-02 10:26 UTC by Sjoerd Simons
Modified: 2006-11-13 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
get_existing_connection improvements (3.40 KB, patch)
2006-11-02 10:28 UTC, Sjoerd Simons
needs-work Details | Review
Updated patch (3.18 KB, patch)
2006-11-13 10:14 UTC, Sjoerd Simons
none Details | Review
Add missing part of the patch (3.52 KB, patch)
2006-11-13 14:09 UTC, Sjoerd Simons
committed Details | Review

Description Sjoerd Simons 2006-11-02 10:26:07 UTC
See attached patch :) It let's get_existing_connection first check if the connection we're trying to match is one for the right protocol :), fixes a crash when Inspecting the self-handle failed and moves the clean-up of the loop (freeing/unreffing) to one central place.
Comment 1 Sjoerd Simons 2006-11-02 10:28:18 UTC
Created attachment 75830 [details] [review]
get_existing_connection improvements
Comment 2 Xavier Claessens 2006-11-06 09:56:12 UTC
*** Bug 368801 has been marked as a duplicate of this bug. ***
Comment 3 Xavier Claessens 2006-11-11 14:28:17 UTC
Some comments on the patch:

 - Your found boolean is never used.
 - I don't like goto, is it possible to not use that ?
 - if statements should always have brackets even if there is only one instruction in the block.

if (foo) {
  bar;
}

Otherwise the patch seems to make his job and fix a crash I have so I would be happy to get it committed if the code is cleaned up :-)

Simons > Can you update your patch ? Sorry I don't have time now to change it myself. Thanks for the patch !!!
Comment 4 Sjoerd Simons 2006-11-13 10:14:01 UTC
Created attachment 76467 [details] [review]
Updated patch

>Some comments on the patch:
>
> - Your found boolean is never used.
 Woops, you found a bug in the patch :) Fixed in this version
> - if statements should always have brackets even if there is only one
>   instruction in the block.
  Fixed.
> - I don't like goto, is it possible to not use that ?
  One can easily prove that you an _always_ avoid goto's. Otoh that doesn't
  mean it's good to do that :)
  By using goto the way i did here itreplaces 5 cleanup blocks by one general 
  one. Which is easier to maintain and easier to prove correctness for :)
Comment 5 Sjoerd Simons 2006-11-13 14:09:58 UTC
Created attachment 76484 [details] [review]
Add missing part of the patch

First part of the patch was missing in the last one.. Adding an updated version
Comment 6 Xavier Claessens 2006-11-13 20:47:26 UTC
commited, thanks !