xpra icon
Bug tracker and wiki

Ticket #1726: xdg-open-url.patch

File xdg-open-url.patch, 27.5 KB (added by Antoine Martin, 2 years ago)

forwarding of xdg-open for URLs

  • etc/xpra/conf.d/15_file_transfers.conf.in

     
    22# File transfers
    33
    44# Receive files
    5 file-transfer = yes
     5#file-transfer = ask
     6#file-transfer = no
     7file-transfer = auto
    68
    79# Location where files are received:
    810#download-path = ~/Downloads
     
    1618#open-command = xdg-open
    1719
    1820# Open files
    19 open-files = no
     21#open-files = no
     22open-files = ask
  • scripts/xdg-open

     
    99
    1010
    1111if os.environ.get("XPRA_XDG_OPEN"):
    12     sys.stderr.write("xdg-open: aborting to avoid forwarding loop")
     12    sys.stderr.write("xdg-open: aborting to avoid forwarding loop\n")
    1313    sys.exit(1)
    1414
    1515socket_path = os.environ.get("XPRA_XDG_OPEN_SERVER_SOCKET")
     
    1616display = os.environ.get("DISPLAY", "unknown")
    1717if socket_path and os.path.exists(socket_path):
    1818    #try to forward open commands:
     19    #sys.stderr.write("xdg-open: forwarding request to xpra server at '%s'\n" % (socket_path,))
    1920    for x in sys.argv[1:]:
    2021        filename = os.path.abspath(x)
    21         if os.path.exists(x) and os.path.isfile(x):
    22             from subprocess import Popen, PIPE
    23             try:
    24                 command = ["xpra", "control", "socket://%s" % socket_path, "send-file", filename, "open", "*"]
    25                 proc = Popen(command, stdin=None, stdout=PIPE, stderr=PIPE, shell=False, close_fds=True)
    26                 out, err = proc.communicate(None)
    27                 if proc.returncode==0:
    28                     sys.exit(0)
    29                 else:
    30                     if out:
    31                         sys.stdout.write(out)
    32                         sys.stdout.flush()
    33                     if err:
    34                         sys.stderr.write(err)
    35                         sys.stderr.flush()
    36             except Exception as e:
    37                 sys.stderr.write("xdg-open: failed to forward to xpra server using socket '%s': %s\n" % (socket_path, e))
    38                 sys.stderr.flush()
     22        #sys.stderr.write("arg: '%s'\n" % x)
     23        if x.find("://")>0:
     24            proto, filename = x.split("://", 1)
     25            if proto=="file":
     26                control_command = ["send-file", filename, "open", "*"]
     27            else:
     28                control_command = ["open-url", x, "*"]
     29        elif os.path.exists(x) and os.path.isfile(x):
     30            control_command = ["send-file", filename, "open", "*"]
     31        else:
     32            sys.stderr.write("xdg-open: unrecognized argument form '%s'\n" % x)
     33            break
     34        from subprocess import Popen, PIPE
     35        try:
     36            command = ["xpra", "control", "socket://%s" % socket_path] + control_command
     37            proc = Popen(command, stdin=None, stdout=PIPE, stderr=PIPE, shell=False, close_fds=True)
     38            sys.stderr.write("Popen(%s)=%s\n" % (command, proc))
     39            out, err = proc.communicate(None)
     40            if proc.returncode==0:
     41                sys.exit(0)
     42            else:
     43                if out:
     44                    sys.stdout.write(out)
     45                    sys.stdout.flush()
     46                if err:
     47                    sys.stderr.write(err)
     48                    sys.stderr.flush()
     49        except Exception as e:
     50            sys.stderr.write("xdg-open: failed to forward to xpra server using socket '%s': %s\n" % (socket_path, e))
     51            sys.stderr.flush()
     52           
    3953
    4054#fallback to the "real" xdg-open:
    4155this_file = os.path.abspath(__file__)
  • xpra/client/client_base.py

     
    306306
    307307    def init_authenticated_packet_handlers(self):
    308308        self.set_packet_handlers(self._packet_handlers, {
    309             "send-file"        : self._process_send_file,
    310             "send-file-request" : self._process_send_file_request,
    311             "send-file-response": self._process_send_file_response,
    312             "ack-file-chunk"   : self._process_ack_file_chunk,
    313             "send-file-chunk"  : self._process_send_file_chunk,
     309            "open-url"          : self._process_open_url,
     310            "send-file"         : self._process_send_file,
     311            "send-data-request" : self._process_send_data_request,
     312            "send-data-response": self._process_send_data_response,
     313            "ack-file-chunk"    : self._process_ack_file_chunk,
     314            "send-file-chunk"   : self._process_send_file_chunk,
    314315            })
    315316
    316317
  • xpra/client/gtk_base/gtk_client_base.py

     
    7272        self.server_commands = None
    7373        self.keyboard_helper_class = GTKKeyboardHelper
    7474        self.border = None
    75         self.file_requests = {}
     75        self.data_send_requests = {}
    7676        #clipboard bits:
    7777        self.local_clipboard_requests = 0
    7878        self.remote_clipboard_requests = 0
     
    299299
    300300    ################################
    301301    # file handling
    302     def ask_file(self, cb_answer, send_id, filename, printit, openit):
     302    def ask_data_request(self, cb_answer, send_id, dtype, url, printit, openit):
    303303        #show a dialog, fire cb_answer with True or False depending on the response
    304304        assert send_id not in self.file_ask_dialogs
    305305        parent = None
     
    310310        else:
    311311            action = "send"
    312312        msgs = (
    313                 "The xpra server is requesting this client to %s the file '%s'" % (action, filename),
     313                "The xpra server is requesting this client to %s the %s '%s'" % (action, dtype, url),
    314314                )
    315315        dialog = gtk.MessageDialog(parent, 0, MESSAGE_INFO,
    316316                                      BUTTONS_OK_CANCEL, "\n".join(msgs))
     
    319319            dialog.set_image(image)
    320320        except Exception as e:
    321321            log.warn("Warning: failed to set dialog image: %s", e)
    322         dialog.connect("response", self.ask_file_response, cb_answer, send_id, filename, printit, openit)
     322        dialog.connect("response", self.ask_file_response, cb_answer, send_id, dtype, url, printit, openit)
    323323        dialog.show()
    324324        self.file_ask_dialogs[send_id] = dialog
    325325
    326     def ask_file_response(self, dialog, response, cb_answer, send_id, filename, printit, openit):
     326    def ask_file_response(self, dialog, response, cb_answer, send_id, dtype, url, printit, openit):
    327327        #the file dialog has been closed
    328328        #tell the cb_answer if the response is OK or not
    329         filelog("ask_file_response%s", (dialog, response, cb_answer, send_id, filename, printit, openit))
     329        filelog("ask_file_response%s", (dialog, response, cb_answer, send_id, dtype, url, printit, openit))
    330330        accept = response == RESPONSE_OK
    331331        dialog.destroy()
    332332        try:
     
    335335            pass
    336336        if accept:
    337337            #record our response, so we will accept the file
    338             self.file_requests[send_id] = (filename, printit, openit)
     338            self.data_send_requests[send_id] = (dtype, url, printit, openit)
    339339        cb_answer(accept)
    340340
    341     def accept_file(self, send_id, filename, printit, openit):
     341    def accept_data(self, send_id, dtype, url, printit, openit):
    342342        #verify that we have accepted this file,
    343343        #and with the same attributes
    344         r = self.file_requests.get(send_id)
     344        r = self.data_send_requests.get(send_id)
    345345        if not r:
    346346            filelog.warn("Warning: received a file which was never accepted")
    347347            return False
    348         if r!=(filename, printit, openit):
     348        if r!=(dtype, url, printit, openit):
    349349            filelog.warn("Warning: the file attributes are different")
    350350            filelog.warn(" from the ones that were used to accept the transfer")
    351             filelog.warn(" expected filename=%s, print=%s, open=%s", *r)
    352             filelog.warn(" received filename=%s, print=%s, open=%s", filename, printit, openit)
     351            filelog.warn(" expected data type=%s, url=%s, print=%s, open=%s", *r)
     352            filelog.warn(" received data type=%s, url=%s, print=%s, open=%s", dtype, url, printit, openit)
    353353            return False
    354354        return True
    355355
  • xpra/net/file_transfer.py

     
    7171            #copy attributes
    7272            for x in ("file_transfer", "file_transfer_ask", "file_size_limit", "file_chunks",
    7373                      "printing", "printing_ask", "open_files", "open_files_ask",
     74                      "open_url", "open_url_ask",
    7475                      "file_ask_timeout", "open_command"):
    7576                setattr(self, x, getattr(attrs, x))
    7677
     
    8990        self.printing = self.printing_ask or parse_bool("printing", printing)
    9091        self.open_files_ask = open_files.lower() in ("ask", "auto")
    9192        self.open_files = self.open_files_ask or parse_bool("open-files", open_files)
     93        #FIXME: command line options needed here:
     94        self.open_url = True
     95        self.open_url_ask = True
    9296        self.file_ask_timeout = SEND_REQUEST_TIMEOUT
    9397        self.open_command = open_command
    9498
     
    103107                "open-files-ask"    : self.open_files_ask,
    104108                "printing"          : self.printing,
    105109                "printing-ask"      : self.printing_ask,
     110                "open-url"          : self.open_url,
     111                "open-url-ask"      : self.open_url_ask,
    106112                "file-ask-timeout"  : self.file_ask_timeout,
    107113                }
    108114
     
    116122                "chunks"            : self.file_chunks,
    117123                "open"              : self.open_files,
    118124                "open-ask"          : self.open_files_ask,
     125                "open-url"          : self.open_url,
     126                "open-url-ask"      : self.open_url_ask,
    119127                "printing"          : self.printing,
    120128                "printing-ask"      : self.printing_ask,
    121129                "ask-timeout"       : self.file_ask_timeout,
     
    136144        self.remote_printing_ask = False
    137145        self.remote_open_files = False
    138146        self.remote_open_files_ask = False
     147        self.remote_open_url = False
     148        self.remote_open_url_ask = False
    139149        self.remote_file_ask_timeout = SEND_REQUEST_TIMEOUT
    140150        self.remote_file_size_limit = 0
    141151        self.remote_file_chunks = 0
    142         self.pending_send_file = {}
    143         self.pending_send_file_timers = {}
     152        self.pending_send_data = {}
     153        self.pending_send_data_timers = {}
    144154        self.send_chunks_in_progress = {}
    145155        self.receive_chunks_in_progress = {}
    146156        self.file_descriptors = set()
     
    152162            self.source_remove = glib.source_remove
    153163
    154164    def cleanup(self):
    155         for t in self.pending_send_file_timers.values():
     165        for t in self.pending_send_data_timers.values():
    156166            self.source_remove(t)
    157         self.pending_send_file_timers = {}
     167        self.pending_send_data_timers = {}
    158168        for v in self.receive_chunks_in_progress.values():
    159169            t = v[-2]
    160170            self.source_remove(t)
     
    187197                          "file-chunks"     : self.remote_file_chunks,
    188198                          "open-files"      : self.remote_open_files,
    189199                          "open-files-ask"  : self.remote_open_files_ask,
     200                          "open-url"        : self.remote_open_url,
     201                          "open-url-ask"    : self.remote_open_url_ask,
    190202                          "printing"        : self.remote_printing,
    191203                          "printing-ask"    : self.remote_printing_ask,
    192204                          "file-ask-timeout" : self.remote_file_ask_timeout,
     
    270282        t = start_thread(self.do_process_downloaded_file, "process-download", daemon=False, args=(filename, mimetype, printit, openit, filesize, options))
    271283        filelog("started process-download thread: %s", t)
    272284
    273     def accept_file(self, _send_id, _basefilename, printit, openit):
     285    def accept_data(self, _send_id, _dtype, _basefilename, printit, openit):
    274286        #subclasses should check the flags,
    275287        #and if ask is True, verify they have accepted this specific send_id
    276288        if printit:
     
    287299        send_id = ""
    288300        if len(packet)>=9:
    289301            send_id = packet[8]
    290         if not self.accept_file(send_id, basefilename, printit, openit):
     302        if not self.accept_data(send_id, "file", basefilename, printit, openit):
    291303            filelog.warn("Warning: file transfer rejected for file '%s'", basefilename)
    292304            return
    293305        options = typedict(options)
     
    353365            self._print_file(filename, mimetype, options)
    354366            return
    355367        elif openit:
    356             self._open_file(filename)
     368            if not self.open_files:
     369                filelog.warn("Warning: opening files automatically is disabled,")
     370                filelog.warn(" ignoring uploaded file:")
     371                filelog.warn(" '%s'", filename)
     372                return
     373            self._open_url("file://%s" % filename)
    357374
    358375    def _print_file(self, filename, mimetype, options):
    359376        printlog("print_file%s", (filename, mimetype, options))
     
    415432            #check every 10 seconds:
    416433            self.timeout_add(10000, check_printing_finished)
    417434
    418     def _open_file(self, filename):
    419         if not self.open_files:
    420             filelog.warn("Warning: opening files automatically is disabled,")
    421             filelog.warn(" ignoring uploaded file:")
    422             filelog.warn(" '%s'", filename)
    423             return
    424         command = shlex.split(self.open_command)+[filename]
     435    def _open_url(self, url):
     436        command = shlex.split(self.open_command)+[url]
    425437        proc = subprocess.Popen(command)
    426438        def open_done(*_args):
    427439            returncode = proc.poll()
    428440            filelog("open_done: command %s has ended, returncode=%s", command, returncode)
    429441            if returncode!=0:
    430                 filelog.warn("Warning: failed to open the downloaded file")
    431                 filelog.warn(" '%s %s' returned %s", self.open_command, filename, returncode)
     442                filelog.warn("Warning: failed to open the downloaded content")
     443                filelog.warn(" '%s %s' returned %s", self.open_command, url, returncode)
    432444        cr = getChildReaper()
    433         cr.add_process(proc, "Open File %s" % filename, command, True, True, open_done)
     445        cr.add_process(proc, "Open URL %s" % url, command, True, True, open_done)
    434446
    435447
    436448    def file_size_warning(self, action, location, basefilename, filesize, limit):
     
    448460            return False
    449461        return True
    450462
     463
     464    def _process_open_url(self, packet):
     465        url, send_id = packet[1:3]
     466        if not self.open_url:
     467            filelog.warn("Warning: received a request to open URL '%s'", url)
     468            filelog.warn(" but opening of URLs is disabled")
     469            return
     470        if self.accept_data(send_id, "url", url, False, True):
     471            self._open_url(url)
     472        else:
     473            filelog("url '%s' not accepted", url)
     474       
     475
     476    def send_open_url(self, url):
     477        if self.open_url_ask:
     478            return self.send_data_request("open", "url", url)
     479        self.do_send_open_url(url)
     480        return True
     481
     482    def do_send_open_url(self, url, send_id=""):
     483        self.send("open-url", url, send_id)
     484
    451485    def send_file(self, filename, mimetype, data, filesize=0, printit=False, openit=False, options={}):
    452486        if printit:
    453487            if not self.printing:
     
    480514        l("send_file%s action=%s, ask=%s", (filename, mimetype, type(data), "%i bytes" % filesize, printit, openit, options), action, ask)
    481515        if not self.check_file_size(action, filename, filesize):
    482516            return False
    483         send_id = uuid.uuid4().hex
    484517        if ask:
    485             if len(self.pending_send_file)>=MAX_CONCURRENT_FILES:
    486                 l.warn("Warning: %s dropped", action)
    487                 l.warn(" %i transfer%s already waiting for a response", len(self.pending_send_file), engs(self.pending_send_file))
    488                 return False
    489             self.pending_send_file[send_id] = (filename, mimetype, data, filesize, printit, openit, options)
    490             self.pending_send_file_timers[send_id] = self.timeout_add(self.remote_file_ask_timeout*1000, self.open_files_ask_timeout, send_id)
    491             l("sending file request for send-id=%s", send_id)
    492             self.send("send-file-request", send_id, filename, mimetype, filesize, printit, openit)
    493             return True
    494         self.do_send_file(filename, mimetype, data, filesize, printit, openit, options, send_id)
     518            return self.send_data_request(action, "file", filename, mimetype, data, filesize, printit, openit, options)
     519        self.do_send_file(filename, mimetype, data, filesize, printit, openit, options)
     520        return True
    495521
    496     def _process_send_file_request(self, packet):
     522    def send_data_request(self, action, dtype, url, mimetype="", data="", filesize=0, printit=False, openit=True, options={}):
     523        send_id = uuid.uuid4().hex
     524        if len(self.pending_send_data)>=MAX_CONCURRENT_FILES:
     525            filelog.warn("Warning: %s dropped", action)
     526            filelog.warn(" %i transfer%s already waiting for a response", len(self.pending_send_data), engs(self.pending_send_data))
     527            return None
     528        self.pending_send_data[send_id] = (dtype, url, mimetype, data, filesize, printit, openit, options)
     529        self.pending_send_data_timers[send_id] = self.timeout_add(self.remote_file_ask_timeout*1000, self.send_data_ask_timeout, send_id)
     530        filelog("sending file request for send-id=%s", send_id)
     531        self.send("send-data-request", dtype, send_id, url, mimetype, filesize, printit, openit)
     532        return send_id
     533
     534
     535    def _process_send_data_request(self, packet):
    497536        #subclasses should prompt the user
    498         send_id, filename, _, _, printit, openit = packet[1:7]
    499         filelog("send-file-request: send_id=%s, filename=%s, printit=%s, openit=%s", send_id, filename, printit, openit)
    500         if printit:
    501             ask = self.printing_ask
    502         elif openit:
    503             ask = self.file_transfer_ask or self.open_files_ask
     537        dtype, send_id, url, _, _, printit, openit = packet[1:8]
     538        filelog("send-data-request: send_id=%s, url=%s, printit=%s, openit=%s", send_id, url, printit, openit)
     539        def cb_answer(accept):
     540            filelog("accept%s=%s", (url, printit, openit), accept)
     541            self.send("send-data-response", send_id, bool(accept))
     542        if dtype=="file":
     543            url = os.path.basename(url)
     544            if printit:
     545                ask = self.printing_ask
     546            elif openit:
     547                ask = self.file_transfer_ask or self.open_files_ask
     548            else:
     549                ask = self.file_transfer_ask
     550        elif dtype=="url":
     551            ask = self.open_url_ask
    504552        else:
    505             ask = self.file_transfer_ask
    506         def cb_answer(accept):
    507             filelog("accept%s=%s", (filename, printit, openit), accept)
    508             self.send("send-file-response", send_id, bool(accept))
     553            filelog.warn("Warning: unkown data request type '%s'", dtype)
     554            cb_answer(False)
    509555        if not ask:
    510             filelog.warn("Warning: received a send-file request,")
     556            filelog.warn("Warning: received a send-data request,")
    511557            filelog.warn(" but authorization is not required by the client")
    512558            cb_answer(True)
    513559        else:
    514             basefilename = os.path.basename(filename)
    515             self.ask_file(cb_answer, send_id, basefilename, printit, openit)
     560            self.ask_data_request(cb_answer, send_id, dtype, url, printit, openit)
    516561
    517     def ask_file(self, _cb_answer, _send_id, _filename, _printit, _openit):
    518         return False
     562    def ask_data_request(self, cb_answer, send_id, dtype, filename, printit, openit):
     563        filelog("ask_data_request%s", (send_id, dtype, filename, printit, openit))
     564        cb_answer(False)
    519565
    520     def _process_send_file_response(self, packet):
     566    def _process_send_data_response(self, packet):
    521567        send_id, accept = packet[1:3]
    522         filelog("send-file-response: send_id=%s, accept=%s", send_id, accept)
    523         timer = self.pending_send_file_timers.get(send_id)
     568        filelog("send-data-response: send_id=%s, accept=%s", send_id, accept)
     569        timer = self.pending_send_data_timers.get(send_id)
    524570        if timer:
    525571            try:
    526                 del self.pending_send_file_timers[send_id]
     572                del self.pending_send_data_timers[send_id]
    527573            except KeyError:
    528574                pass
    529575            self.source_remove(timer)
    530         v = self.pending_send_file.get(send_id)
     576        v = self.pending_send_data.get(send_id)
    531577        if not v:
    532578            filelog.warn("Warning: cannot find send-file entry")
    533579            return
    534580        try:
    535             del self.pending_send_file[send_id]
     581            del self.pending_send_data[send_id]
    536582        except KeyError:
    537583            pass
    538         filename, mimetype, data, filesize, printit, openit, options = v
     584        dtype = v[0]
     585        url = v[1]
    539586        if not accept:
    540             filelog.info("the request to send file '%s' has been denied", filename)
     587            filelog.info("the request to send %s '%s' has been denied", dtype, url)
    541588            return
    542         self.do_send_file(filename, mimetype, data, filesize, printit, openit, options, send_id)
     589        if dtype=="file":
     590            mimetype, data, filesize, printit, openit, options = v[2:]
     591            self.do_send_file(url, mimetype, data, filesize, printit, openit, options, send_id)
     592        elif dtype=="url":
     593            self.do_send_open_url(url, send_id)
     594        else:
     595            filelog.error("Error: unknown datatype '%s'", dtype)
    543596
    544     def open_files_ask_timeout(self, send_id):
    545         v = self.pending_send_file_timers.get(send_id)
     597    def send_data_ask_timeout(self, send_id):
     598        v = self.pending_send_data_timers.get(send_id)
    546599        if not v:
    547600            filelog.warn("Warning: send timeout, id '%s' not found!", send_id)
    548601            return False
    549602        try:
    550             del self.pending_send_file[send_id]
    551             del self.pending_send_file_timers[send_id]
     603            del self.pending_send_data[send_id]
     604            del self.pending_send_data_timers[send_id]
    552605        except KeyError:
    553606            pass
    554607        filename = v[0]
  • xpra/scripts/server.py

     
    950950                    xdg_override = os.path.join(x, "xdg-open")
    951951                    if os.path.exists(xdg_override):
    952952                        os.environ["PATH"] = x+os.pathsep+os.environ.get("PATH", "")
     953                        break
    953954
    954955        log("env=%s", os.environ)
    955956        try:
  • xpra/server/server_base.py

     
    735735            "send-file":                            self._process_send_file,
    736736            "ack-file-chunk":                       self._process_ack_file_chunk,
    737737            "send-file-chunk":                      self._process_send_file_chunk,
    738             "send-file-request":                    self._process_send_file_request,
    739             "send-file-response":                   self._process_send_file_response,
     738            "send-data-request":                    self._process_send_data_request,
     739            "send-data-response":                   self._process_send_data_response,
    740740            "webcam-start":                         self._process_webcam_start,
    741741            "webcam-stop":                          self._process_webcam_stop,
    742742            "webcam-frame":                         self._process_webcam_frame,
     
    745745            "sharing-toggle":                       self._process_sharing_toggle,
    746746            "lock-toggle":                          self._process_lock_toggle,
    747747            "command-signal":                       self._process_command_signal,
    748             "open":                                 self._process_open,
    749748          }
    750749        self._authenticated_ui_packet_handlers = self._default_packet_handlers.copy()
    751750        self._authenticated_ui_packet_handlers.update({
     
    838837            ArgsControlCommand("toggle-feature",        "toggle a server feature on or off", min_args=2, validation=[str, parse_boolean_value]),
    839838            #network and transfers:
    840839            ArgsControlCommand("print",                 "sends the file to the client(s) for printing", min_args=1),
     840            ArgsControlCommand("open-url",              "open the URL on the client(s)",    min_args=1, max_args=2),
    841841            ArgsControlCommand("send-file",             "sends the file to the client(s)",  min_args=1, max_args=4),
    842842            ArgsControlCommand("send-notification",     "sends a notification to the client(s)",  min_args=4, max_args=5, validation=[int]),
    843843            ArgsControlCommand("close-notification",    "send the request to close an existing notification to the client(s)", min_args=1, max_args=2, validation=[int]),
     
    17841784        return msg
    17851785
    17861786
     1787    def control_command_open_url(self, url, client_uuids="*"):
     1788        #find the clients:
     1789        sources = self._control_get_sources(client_uuids)
     1790        if not sources:
     1791            raise ControlError("no clients found matching: %s" % client_uuids)
     1792        clients = 0
     1793        for ss in sources:
     1794            if ss.send_open_url(url):
     1795                clients += 1
     1796        return "url sent to %i clients" % clients
     1797
    17871798    def control_command_send_file(self, filename, openit="open", client_uuids="*", maxbitrate=0):
    17881799        openit = str(openit).lower() in ("open", "true", "1")
    17891800        return self.do_control_file_command("send file", client_uuids, filename, "file_transfer", (False, openit))
     
    20782089            self.send_disconnect(proto, "screenshot failed: %s" % e)
    20792090
    20802091
    2081     def _process_open(self, proto, packet):
    2082         pass
    2083 
    20842092    def _process_send_file(self, proto, packet):
    20852093        ss = self._server_sources.get(proto)
    20862094        if not ss:
     
    21022110            return
    21032111        ss._process_send_file_chunk(packet)
    21042112
    2105     def _process_send_file_request(self, proto, packet):
     2113    def _process_send_data_request(self, proto, packet):
    21062114        ss = self._server_sources.get(proto)
    21072115        if not ss:
    21082116            log.warn("Warning: invalid client source for send-file-request packet")
    21092117            return
    2110         ss._process_send_file_request(packet)
     2118        ss._process_send_data_request(packet)
    21112119
    2112     def _process_send_file_response(self, proto, packet):
     2120    def _process_send_data_response(self, proto, packet):
    21132121        ss = self._server_sources.get(proto)
    21142122        if not ss:
    2115             log.warn("Warning: invalid client source for send-file-response packet")
     2123            log.warn("Warning: invalid client source for send-data-response packet")
    21162124            return
    2117         ss._process_send_file_response(packet)
     2125        ss._process_send_data_response(packet)
    21182126
    21192127    def _process_print(self, _proto, packet):
    21202128        #ie: from the xpraforwarder we call this command: