Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

large clipboard packets cause the connection to drop #156

Closed
totaam opened this issue Jul 2, 2012 · 4 comments
Closed

large clipboard packets cause the connection to drop #156

totaam opened this issue Jul 2, 2012 · 4 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jul 2, 2012

Issue migrated from trac ticket # 156

component: core | priority: major | resolution: fixed

2012-07-02 03:19:09: mebourne created the issue


I cut-n-paste a page of html from firefox running locally to evolution running over xpra, it consistently crashes the xpra client:

Attached (press Control-C to detach)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/proxy.py", line 25, in _to_client_loop
    self._copy_loop("<-server", self._server_conn, self._client_conn)
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/proxy.py", line 35, in _copy_loop
    buf = from_conn.read(4096)
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/protocol.py", line 68, in read
    return self._s.recv(n)
error: [Errno 104] Connection reset by peer

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/proxy.py", line 29, in _to_server_loop
    self._copy_loop("->server", self._client_conn, self._server_conn)
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/proxy.py", line 42, in _copy_loop
    buf = buf[to_conn.write(buf):]
  File "/home/martin/stuff/xpra/Xpra/trunk/src/install/lib/python/xpra/protocol.py", line 71, in write
    return self._s.send(buf)
error: [Errno 32] Broken pipe

Connection lost

On the server log it says:

connection lost: read buffer too big: 40960 (maximum is 32768), dropping this connection!
Connection lost
xpra client disconnected.

I am running r990 both ends.

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2012

2012-07-02 07:33:46: antoine commented


Thanks very much for the detailed bug report!

This bug was introduced by r784 (see #68): we set a maximum packet size for client packets, and your clipboard packet is bigger than that... (something I never tested)

The fix in r994 is to increase the maximum client packet size to 1MB and to force zlib compression on those clipboard packets.
I am unsure whether it makes sense to allow anything bigger than 1MB as clipboard contents over the network... I guess that if we do not, what we should do is drop the clipboard contents rather than the connection!
(so keeping this ticket open for now)

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2012

2012-07-02 09:27:26: mebourne commented


Thx for the fix, will try it out.

Cut-n-paste of screen shots/images would exceed 1MB perhaps? I don't generally do this over remote, but certainly do locally and seems reasonable to allow it.

@totaam
Copy link
Collaborator Author

totaam commented Jul 9, 2012

2012-07-09 07:56:23: mebourne commented


Confirming fix works for me.

@totaam
Copy link
Collaborator Author

totaam commented Aug 27, 2012

2012-08-27 18:56:39: antoine commented


Fixed properly:

  • r1386 for trunk
  • 1402 for 0.5.x
  • 1403 for 0.3.x and 0.4.x branches

We will drop the packets before they cause problems.
0.5 and later do this after compressing the clipboard packet whereas earlier versions cannot (and therefore their clipboard packet limit will be lower)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant