After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 560787 - Should support IPv4 file transfer
Should support IPv4 file transfer
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: File Transfer
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on: 582736
Blocks:
 
 
Reported: 2008-11-14 12:54 UTC by Guillaume Desmottes
Modified: 2009-06-12 10:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Guillaume Desmottes 2008-11-14 12:54:25 UTC
According to the spec, the IPv4 socket is mandatory in any FileTransfer implementation. So Empathy should support it as well.
Comment 1 Frederic Peters 2008-12-10 11:12:20 UTC
NOTGNOME?  https://bugs.freedesktop.org/show_bug.cgi?id=18530
Comment 2 Guillaume Desmottes 2008-12-10 11:17:31 UTC
No. The freedesktop bug is about the CM side and this one about the client (Empathy) side.
Comment 3 Guillaume Desmottes 2009-03-19 15:37:03 UTC
Note that my Gabble 'file-transfer+inet' branch implements Inet4 (and 6) socket support.
Comment 4 Cosimo Cecchi 2009-05-20 10:26:18 UTC
My ft_ipv4 [1] branch, (which is done on top of my ft_rework one) implements the Empathy part.

[1] http://git.collabora.co.uk/?p=user/cosimoc/empathy.git;a=shortlog;h=refs/heads/ft_ipv4
Comment 5 Jonny Lamb 2009-05-20 12:09:20 UTC
Could you clarify where ft_rework ends and ft_ipv4 starts please?
Comment 6 Cosimo Cecchi 2009-05-20 12:26:59 UTC
Try now, it didn't let you see the tags for heads of the branches as I cherry-picked a commit from ft_rework to ft_ipv4 and forgot to rebase.
Comment 7 Guillaume Desmottes 2009-06-04 11:44:26 UTC
- Your branch doesn't "make check"

  if (priv->socket_address_type == TP_SOCKET_ADDRESS_TYPE_UNIX)
    domain = AF_UNIX;

  if (priv->socket_address_type == TP_SOCKET_ADDRESS_TYPE_IPV4)
should be an "else if"

      res = connect (fd, (struct sockaddr*) &addr, sizeof (addr));
this line is duplicated. You should early return if socket_address_type has a different value. Currently you create an error using errno which wouldn't have a meaning value in that case.

initialize_empty_ac_variant: you don't set any value in the IPV4 case.

do_constructed: having to pull the AvailableSocketTypes seems a bit unfortunate as we already got it from the channel-properties dict (returned by CreateChannel() or in the NewChannels signal). Couldn't we reuse it from there?

Comment 8 Cosimo Cecchi 2009-06-07 13:19:37 UTC
Guillaume, thanks for the review.

(In reply to comment #7)
> - Your branch doesn't "make check"

Fixed.

>   if (priv->socket_address_type == TP_SOCKET_ADDRESS_TYPE_UNIX)
>     domain = AF_UNIX;
> 
>   if (priv->socket_address_type == TP_SOCKET_ADDRESS_TYPE_IPV4)
> should be an "else if"
>       res = connect (fd, (struct sockaddr*) &addr, sizeof (addr));
> this line is duplicated. You should early return if socket_address_type has a
> different value. Currently you create an error using errno which wouldn't have
> a meaning value in that case.

Should be all fixed now.

> initialize_empty_ac_variant: you don't set any value in the IPV4 case.

Maybe I misunderstood the purpose of TpSocketAccessControl, but that was intentional; I thought that, as we don't want to impose file transfer being on a specific interface/port, we are fine with the default values the CM chooses for us, so the SocketAccessControl variant we associate with the transfer is always empty. Am I missing something?

> do_constructed: having to pull the AvailableSocketTypes seems a bit unfortunate
> as we already got it from the channel-properties dict (returned by
> CreateChannel() or in the NewChannels signal). Couldn't we reuse it from there?

Right; this would involve adding caching code to EmpathyDispatcher (which makes sense to me if it avoids DBus roundtrips), but IMHO it's outside the scope of this branch. I can work on this in a separate branch once this has landed if we want to have it.
Comment 9 Guillaume Desmottes 2009-06-08 16:31:22 UTC
(In reply to comment #8)
> > initialize_empty_ac_variant: you don't set any value in the IPV4 case.
> 
> Maybe I misunderstood the purpose of TpSocketAccessControl, but that was
> intentional; I thought that, as we don't want to impose file transfer being on
> a specific interface/port, we are fine with the default values the CM chooses
> for us, so the SocketAccessControl variant we associate with the transfer is
> always empty. Am I missing something?

If you want to use the Port ACL, you are supposed to set in the variant a Socket_Address_IPv4 structur containing the IP and port FROM which you are going to connect to CM's socket. CM will reject any connection which are not from this ip/port.
Tbh, I think you shouldn't implement Port in Empathy until we have a CM implementing it. Just use LocalHost for now.


> > do_constructed: having to pull the AvailableSocketTypes seems a bit unfortunate
> > as we already got it from the channel-properties dict (returned by
> > CreateChannel() or in the NewChannels signal). Couldn't we reuse it from there?
> 
> Right; this would involve adding caching code to EmpathyDispatcher (which makes
> sense to me if it avoids DBus roundtrips), but IMHO it's outside the scope of
> this branch. I can work on this in a separate branch once this has landed if we
> want to have it.

I agree. Please feel a bug (and a fix ;) about that once your branch is merged.

Comment 10 Cosimo Cecchi 2009-06-12 10:06:06 UTC
Merged in master, closing.