Opened 9 years ago

Closed 8 years ago

#12622 closed patch (cantfix)

BOSH connection to XMPP server through proxy fails

Reported by: hgiddens Owned by: darkrain42
Milestone: Patches Needing Improvement Component: XMPP
Version: 2.7.3 Keywords:


Connecting to an XMPP server via BOSH through a HTTP proxy that presumably doesn't support pipelining fails with the message "Lost connection with server: Bad file descriptor". stracing pidgin reveals that write is being called with a file descriptor of -1:

write(-1, "POST /http-bind/ HTTP/1.1\r\nHost:"..., 393) = -1 EBADF

This seems to be caused by the pipelining-not-supported path in http_connection_disconnected in bosh.c which calls http_connection_connect on conn->bosh->connections[1] before trying to reconnect conn (i.e., conn->bosh->connections[0]). The connection callback for connections[1] is then called before the callback for connections[0], and when jabber_bosh_connection_boot is called, it passes the uninitialised connections[0] to http_connection_send_request.

The attached patch fixes this by reconnecting connections[0] before connections[1].

Attachments (1)

switch-connection-restart-order.patch (1.4 KB) - added by hgiddens 9 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by hgiddens

comment:1 Changed 9 years ago by QuLogic

  • Component changed from unclassified to XMPP
  • Milestone set to Patches Needing Review
  • Owner changed from rekkanoryo to darkrain42

comment:2 Changed 9 years ago by darkrain42

hgiddens, what name and email address should you be credited with?

comment:3 Changed 9 years ago by darkrain42

Actually, this isn't going to resolve the issue; it's just going to mitigate it. There's no guarantee that the first connection connected here is actually going to be the first one to fully connect (which depends on network conditions), if I understand the issue correctly. I'm still looking at the code, though.

comment:4 Changed 9 years ago by darkrain42

  • Milestone changed from Patches Needing Review to Patches Needing Improvement
  • Status changed from new to pending

In fact, I'm not sure I see how this happens. Could you provide a debug log from Pidgin when you get that message? The proxy shouldn't be kicking you off from the first POST (the 'boot'), since we necessarily should be (if I remember the spec correctly) waiting for a response before continuing (at which point we should have a session, and it should no longer be booting up)

comment:5 Changed 9 years ago by trac-robot

  • Status changed from pending to closed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

comment:6 Changed 9 years ago by Robby

  • Status changed from closed to new

comment:7 Changed 8 years ago by darkrain42

  • Resolution set to cantfix
  • Status changed from new to closed

I'm closing this again; pretty sure my previous statements stand.

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!