Opened 11 years ago

Closed 11 years ago

#6231 closed defect (fixed)

Bonjour many users on same server message redirection goes wrong

Reported by: fmarkos Owned by: datallah
Milestone: 2.5.0 Component: Bonjour
Version: 2.4.2 Keywords:
Cc:

Description

I use the Bonjour protocol to connect users in my company, PCs/Macs. Some users are remote and connect to the network through remote desktop on a Windows 2003 server I install Bonjour and pidgin on this server and set up each user with a different "First name" and "Last name". The host name remains the same. I activated the windows plugin so Pidgin runs automatically when users logon. Everything looks OK the users appear in the list but when sending a message to someone in about 40% of times the message goes to a wrong account! (On the same server) That makes the whole thing unpredictable and unreliable. This happened with both 2.4.1 and 2.4.2 Help please!

Attachments (1)

purple-debug.log.zip (5.6 KB) - added by fmarkos 11 years ago.
2 users on same server 1 user on same LAN

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by datallah

Hmm... it shouldn't be possible to advertise several instances on the same machine, I think that is what the real problem is.

comment:2 follow-up: Changed 11 years ago by fmarkos

So the messages are not delivered according to username but according to what? This might be a Bonjour limitation. If yes, pidgin shouldn't allow you to run multiple instances on the same server. (At least it should warn you) This is a weird behavior. I wish I could trace it's logic, because the messages seem to be going to a random user each time. I wonder what rules it follows to behave like that.

On another subject: Does anyone know which TCP/UDP ports I need to forward in my router so pidgin can work with bonjour? Thanks.

comment:3 in reply to: ↑ 2 Changed 11 years ago by datallah

Replying to fmarkos:

So the messages are not delivered according to username but according to what? This might be a Bonjour limitation. If yes, pidgin shouldn't allow you to run multiple instances on the same server. (At least it should warn you) This is a weird behavior. I wish I could trace it's logic, because the messages seem to be going to a random user each time. I wonder what rules it follows to behave like that.

Actually, Bonjour presences are in the form of username@machinename, so it seems like it should be possible to make it work, I need to do some more digging. Basically each user runs a separate local server on a different port, so either the wrong port is getting advertised, or we're connecting to the wrong port when sending a message to the user.

When one of the Mac users (using iChat) tries to initiate a chat with one of the Pidgin users, does that work consistently?

On another subject: Does anyone know which TCP/UDP ports I need to forward in my router so pidgin can work with bonjour?

I'm not sure what you mean here. Bonjour only works on your local network, your router isn't a factor and you don't need to forward any ports (where would you forward them to?).

comment:4 follow-up: Changed 11 years ago by fmarkos

Actually, Bonjour presences are in the form of username@machinename, so it seems like it should be possible to make it work, I need to do some more digging. Basically each user runs a separate local server on a different port, so either the wrong port is getting advertised, or we're connecting to the wrong port when sending a message to the user.

I tried changing the server name in pidgin so it was user1@asus1 user2@asus2 but it still didn't work right.

When one of the Mac users (using iChat) tries to initiate a chat with one of the Pidgin users, does that work consistently?

No, same behavior like from pidgin to pidgin.

I'm not sure what you mean here. Bonjour only works on your local network, your router isn't a factor and you don't need to forward any ports (where would you forward them to?).

Forget about it, for a moment I thought I could forward those ports from a PC on LAN -1 to a pc on LAN-2 and make bonjour connection across LANs

comment:5 in reply to: ↑ 4 Changed 11 years ago by datallah

  • pending changed from 0 to 1

Replying to fmarkos:

I tried changing the server name in pidgin so it was user1@asus1 user2@asus2 but it still didn't work right.

Interesting.

When one of the Mac users (using iChat) tries to initiate a chat with one of the Pidgin users, does that work consistently?

No, same behavior like from pidgin to pidgin.

Can you provide a full debug log from both instances of Pidgin when attempting to communicate, please.

Changed 11 years ago by fmarkos

2 users on same server 1 user on same LAN

comment:6 Changed 11 years ago by fmarkos

  • pending changed from 1 to 0

Ok I attached the log files from 3 users. 2 on same server (asus) and 1 on a PC in the LAN

comment:7 Changed 11 years ago by datallah

Based on the logs, I don't understand what is happening. Each of the users appears to have a different (unique) IP, so I'm not sure how crosstalk could be an issue here.

Maybe I'm misunderstanding what the problem you're experiencing actually is. Can you please outline the specific steps you're following, what happens and what you expect to happen.

The attached debug logs aren't complete enough (they don't contain the output from then the accounts signed on). One of the "markos" logs seems to be talking to himself (which shouldn't be possible to try) - is there a third markos that they are both trying to talk to.

comment:8 Changed 11 years ago by fmarkos

Actually two users (markos@asus and akis-mponelis@asus) are remote desktop users on the same server with IP:170.200.100.250 and the third user is markosf@markosf with the IP:170.200.100.50

On akis-mponelis@asus log you will see: (16:35:59) bonjour: Registering presence on port 5298

and on markos@asus you see: (16:36:19) bonjour: Found buddy mponelis@asus1 at 170.200.100.250:5298 (16:36:19) blist: Updating buddy status for mponelis@asus1 (Bonjour) There is no registering presence for user markos@asus (unless the log didn't catch it.) Probably because port 5298 was already opened by the first run instance of pidgin.

The error when message redirection goes awry appears in markos@asus log: (16:37:59) bonjour: receive error: Remote host closed connection. Despite the fact that the user is visible in the "buddy list". When you send him a message the above error is displayed and the message goes to another user!

It seems bonjour can not support multi user instances on the same PC-server (IP address) So we'll keep on using NetSend? GUI from Fomine, which sucks but works. Unless you have another suggestion.

Thanks.

comment:9 Changed 11 years ago by datallah

I figured out what is happening.

For some reason, the server socket was being set to allow the port to be shared. This means that all the users on the machine were listening on the same port (which was the cause of the mixed up messages).

comment:10 Changed 11 years ago by datallah@…

  • Milestone set to 2.5.0
  • Resolution set to fixed
  • Status changed from new to closed

(In 2a68f533ef12aaf2b26c7827857687c4ff04b229):
Fix running several Bonjour instances on the same machine. The server socket had SO_REUSEADDR set, which was causing all the instances to share the same port (and therefore it was indeterminate who would actually get the incoming connection). Fixes #6231

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!