[Pidgin] #17025: pidgin bosh very slow

Pidgin trac at pidgin.im
Sat Nov 25 07:28:28 EST 2017


#17025: pidgin bosh very slow
------------------------+---------------------
 Reporter:  coolguy333  |       Owner:  deryni
     Type:  defect      |      Status:  new
Milestone:              |   Component:  XMPP
  Version:  2.10.12     |  Resolution:
 Keywords:              |
------------------------+---------------------

Comment (by niconiconi):

 I investigated the issue.

 I found Pidgin creates a long-waiting connection to receive messages from
 the BOSH server, but doesn't create the second connection for sending
 immediate messages from the client (''XEP-0124: If the client has data to
 send while a request is still open, it establishes a second socket
 connection to the connection manager to send a new request''). Therefore
 any requests from the client would stuck until the long-waiting connection
 times out, which is set by the server and typically around 30 to 60
 seconds.

 Further code review showed Pidgin actually intended to use HTTP Pipelining
 to avoid creating the second connection. Unfortunately may work for some
 servers, but not others. And it's also wrong.

 == HTTP Pipelining is wrong in Theory ==

 HTTP Pipelining is a protocol violation, according to

 '''
 RFC-2616, Section 8, since non-idempotent requests, like those using POST,
 should not be pipelined.
 XEP-0124, 18.1 HTTP Pipelining, clients and connection managers SHOULD NOT
 use HTTP Pipelining.
 '''
 == HTTP Pipelining is wrong in practice ==

 What actually happened to me: I was using nginx to proxy the BOSH server.
 Nginx supports HTTP Pipelining, so Pidgin would believe pipelining is
 okay, and would not use the 2-connection fallback. However nginx does not
 send pipelined requests to the backend server, but send them one-by-one.
 So the 60-second long waiting connection would block any further requests.

 For standard compliant clients, this kind of issue never exists. And the
 point of having BOSH at all, is to go through restrictive intermediate
 proxies. '''So we should kill HTTP Pipelining.'''

 Actually the XMPP standard has made the same mistake, it recommended
 people to use HTTP Pipeline as of 2007-02-21. I believe the BOSH code in
 Pidgin was written around that time. And it has been corrected to forbid
 pipeline later, since 2008-10-29.

--
Ticket URL: <https://developer.pidgin.im/ticket/17025#comment:2>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list