Adium

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#6466 closed defect (fixed)

Adium thinks it is still connected if Airport is manually turned off

Reported by: jad Owned by: nobody
Milestone: Adium X 1.1 Component: Adium Core
Version: Severity: normal
Keywords: Cc:
Patch Status: Accepted

Description

Environment:

  • Any laptop connected to an Airport network.
  • I'm specifically on a MBP w/ Mac OS X 10.4.8.
  • Running Adium from the SVN trunk.

Steps to reproduce:

  • Open Adium and connect to one or more IM services.
  • Turn off Airport by clicking on the Airport icon in the menu bar and choosing "Turn Airport Off"

Expected results:

  • Adium accounts will reflect that they've been disconnected.

Actual results:

  • The Adium accounts still think they're connected.

This is due to a bug in the way "reachability" is determined in the file Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m.

Attachments (1)

ticket6466.diff (837 bytes) - added by jad 13 years ago.
Patch to fix the detection of reachability.

Download all attachments as: .zip

Change History (17)

Changed 13 years ago by jad

Attachment: ticket6466.diff added

Patch to fix the detection of reachability.

comment:1 Changed 13 years ago by Evan Schoenberg

kSCNetworkFlagsIsDirect is *never* true so far as I can tell on my system when checking reachability to a remote host. What does the rest of our Network configuration look like in system prefs? Do you have a modem, ethernet, ip over firewire, etc. configured?

comment:2 Changed 13 years ago by Evan Schoenberg

A further note: On my system, in which ariport,built in ethernet, bluetooth, VPN (PPTP), internal modem, and built-in firewire all enabled (and ordered as listed) but only airport has an IP address, turning airport off changes to:

12:52:08 trc---- www.google.com

(transient, reachable, connection required - which Adium reads as 'not connected' since the check is for reachable & no connection required). Turning airport back on changes to:

12:52:16 -r----- www.google.com

(reachable - 'connected').

comment:3 Changed 13 years ago by jad

On my MBP, when I open System Preferences and click "Network," I have the following connections listed in the middle of the window, in order:

  • Airport
  • Bluetooth
  • Built-in FireWire

Under the "Show" pop-up list on that screen, I have, in order:

  • Bluetooth
  • Built-in Ethernet
  • Airport
  • Built-in Firewire

Airport is the only one with an IP address.

I made a development build of Adium, which prints the CONNECTIVITY_DEBUG code. With Adium connected, when I turn Airport off, it prints:

2007-02-18 13:59:58.736 Adium[14813] *** hostReachabilityChangedCallback got flags: -r----d

When I turn it back on, it prints:

2007-02-18 14:00:33.790 Adium[14813] *** hostReachabilityChangedCallback got flags: -r-----

comment:4 Changed 13 years ago by Jordan

This has either been fixed in the latest SVN or was never a problem.

When I am connected to MSN and GTalk/Jabber, then manually disable wireless, not only does my contact list disappear, and the status in the chat window change to offline, but if you check accounts in the preferences, it states my accounts are offline. Re-enabling airport/wireless allows Adium to reconnect to services and everything is again reflected as online.

This can probably be closed?

Jordan

comment:5 Changed 13 years ago by Jordan

Patch Status: None
Resolution: fixed
Status: newclosed

I'm going to close this since nobody seems to be complaining about it still being a problem. If it is still a problem, it's not very obvious...

comment:6 in reply to:  5 Changed 13 years ago by Mark Johnson

Replying to jas8522:

I'm going to close this since nobody seems to be complaining about it still being a problem. If it is still a problem, it's not very obvious...

I cn replicate the problem right now using the official version then one compiled with the patch file added. The patch definitely works.

comment:7 Changed 13 years ago by Eric Richie

field_haspatch: 01
Milestone: Needs dev review
Patch Status: NoneNeeds Dev Review
pending: 1
Resolution: fixed
Status: closedreopened

This issue seems to be fixed in the current 1.1svn without the patch. However I am going to reopen this so the patch can be evaluated to see if it will do anything else for us.

comment:8 Changed 13 years ago by Mark Johnson

It appears to solve my 5678 ticket as well. Just to confirm as I am a bit of an XCode newbie:

  • I downloaded the source
  • I patched the file identified
  • I build the Frameworks project
  • I built the main project
  • I used the application built

Since then it all works well for me (in relation to 5678 I mean).

comment:9 Changed 13 years ago by Mark Johnson

I have removed the patch and re-built and I will see if the 1.1svn already fixes the problem as you suggest. I have used it a day so far and it seems to be fine however I haven't switch networks yet.

comment:10 Changed 13 years ago by Mark Johnson

I can confirm that the 1.1svn still gets the error on change of network. It gets the reachability flags of -r-------- and hence fails thinking the network is up.

I would therefore ask that the patch is applied to the trunk and go out with the next release!

comment:11 in reply to:  10 Changed 13 years ago by Evan Schoenberg

Replying to mark.johnson:

I can confirm that the 1.1svn still gets the error on change of network. It gets the reachability flags of -r-------- and hence fails thinking the network is up.

I would therefore ask that the patch is applied to the trunk and go out with the next release!

If you're getting -r-------- this patch wouldn't help; that says reachable without needing to make a connection.

I'm concerned about this patch because I think it will cause directly reachable servers -- such as a local Jabber server -- to be considered nonreachable. Can anyone comment on that?

comment:12 Changed 13 years ago by Mark Johnson

Sorry, my previous comment is wrong. My flags are -r------d and hence the patch checks that it is not d. You are right that -r-------- means it is all OK.

comment:13 Changed 13 years ago by Evan Schoenberg

Milestone: Needs dev reviewAdium X 1.1

I'm willing to try this out in the 1.1 beta run and see how it goes. I've never gotten the 'd' flag in my testing, so I can't tell whether this poses a problem or not.

comment:14 Changed 13 years ago by Evan Schoenberg

pending: 10

(Pending ticket plugin doesn't seem to be working properly; I'll investigate that later)

comment:15 Changed 13 years ago by Evan Schoenberg

Resolution: fixed
Status: reopenedclosed

(In [20040]) Patch from jad (thanks!): Don't treat 'Direct' as an acceptable way of reaching a host. This appears to fix a problem for some network configrations in which Adium would incorrectly think it could reach a host and therefore try to connect. I'm not backporting this to adium-1.0, so it will be present only in the 1.1 beta; let's see if it fixes more problems than it causes.

Fixes #6466. Fixes #5678.

comment:16 Changed 12 years ago by Robert

Patch Status: Needs Dev ReviewAccepted
Note: See TracTickets for help on using tickets.