• Takeshi Abe's avatar
    osl: Remember the last error before returning osl_Socket_Error · ad896151
    Takeshi Abe yazdı
    This prevents from e.g. com.sun.star.bridge.UnoUrlResolver's
    emitting confusing messages, when trying to connect to a port
    on which no LibreOffice process is listening, like:
    > Traceback (most recent call last):
    >  File "<stdin>", line 1, in <module>
    >  __main__.NoConnectException: Connector : couldn't connect to socket (Success)
                                                                            ^^^^^^^
    After applying this patch:
    > Traceback (most recent call last):
    >  File "<stdin>", line 1, in <module>
    >  __main__.NoConnectException: Connector : couldn't connect to socket (Connection refused)
    
    You can see the above behavior with the following python code:
    
    import uno
    x = uno.getComponentContext()
    y = x.ServiceManager
    z = y.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", x)
    url = "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
    a = z.resolve(url)
    
    ... provided that no process is waiting on port 2002.
    
    Change-Id: Id094cf9271fe77d84f2284d91a0e452448de2bc2
    Reviewed-on: https://gerrit.libreoffice.org/52018Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
    ad896151
Adı
Son kayıt (commit)
Son güncelleme
..
all Loading commit data...
unx Loading commit data...
w32 Loading commit data...