Sunday, September 11, 2011

GSOC is over, now what?

Let's review what I did this summer:

* Stream Management

* IBB fallback for jingleFT

* Bidirectional Socks5 for jingleFT

I'm satisfied with what I have accomplished this summer. It was a wonderful experience. I would like to thank Yann (my mentor), Kevin (for putting up with all my annoying questions), Matt and Tobias.

My journey doesn't end here. I will continue to work in gajim. My goal is to have a full working implementation of jingle in gajim. For the bidirectional socks5, I had to rewrite a lot of stuff to make it work. Currently OpenSSL and proxies aren't working, but they will be fixed soon.


I've been a little distant this month because I've been partying like it is 1999


Sunday, July 31, 2011

Bidirectional jingle socks5 file transfer in Gajim

I've been busy these couple of weeks trying to make bidirectional jingle socks5 file transfer in Gajim. Currently in Gajim, it is the receiver who connects to the sender.

There are several class of interest here: SocksQueue, Socks5, Socks5Sender, Socks5Listener, and Socks5Receiver

Socks5Listener is the class in charge of binding to a port and accepting connections.  SocksQueue manages the file transfer, it keeps track of when a transfer is completed or canceled.

 Socks5Sender and Socks5Receiver, are in charge of sending and receiving the file, both of them are derived from the class Socks5. So, they are basically the same object with some minor differences.




As it can be seen from this picture, both objects are fairly similar, except for the receiver having the connect, do_connect, is_connected methods and the sender having the send_file method.

 Those objects are also in charged of the socks5 negotiation and they keep track of it by using this state machine:

StatusOperation
0 About to connect
1send version and auth types  / initial read
2 read auth response / reply with desired auth type
3 send 'connect' request /  read connect request
4 get approve of our request / approve connect
5????? / read file
6 retrieve file / ????


There are more states, but these are the most important. What I have been doing so far is that have been modifying the objects so that they can emulate each other. Each object, for every state, will only do the thing that's after the "/" or before it. As I wrote the table, the operation in the left side of the "/" is what the receiver does and in the the right side of it, is what the sender does.

So far in my code, the receiver and the sender, do the operations in from state 0-2 . But then I realized that my approach was wrong all along. Instead of making the objects do both operations, Socks5 should be able to do both operations, and then the receiver and the sender can just inherit that behavior.

Sunday, July 10, 2011

IBB fallback working

The jingleFT branch of Gajim is now able to fall back to IBB when socks5 can't connect. Now, onto the testing phase. I have to write a test suite and maybe test IBB fallback with another client.

There isn't much to update. It works!

Thursday, June 30, 2011

IBB status

I've been meaning to write my report earlier, but I thought I would be finish with IBB by monday. At that point I had successfully transfered files over IBB doing a transport-replace.

The thing was that I was forcing Gajim to do a transport-replace right after the jingle session initiates. That was good for testing, but in the real world scenario, transport-replace would only come after Gajim recieves the following stanza:

<iq from='target@example.org/bar'
    id='hu3vax16'
    to='requester@example.com/foo'
    type='error'>
  <error type='cancel'>
    <item-not-found 
        xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>


I encountered an array of minor problems related to the JingleFT branch, that have prevented me from successfully test for the IBB fallback. Hopefully they will be sorted out by the end of this week.

Monday, June 20, 2011

Wednesday, June 15, 2011

Resumption is working


That's a video with stream management resumption working. To tell what is going on, you need to put it in full screen.




All left to do is to test and then write some documentation on it.

Here's the diagram for the smacks class.





I will give a more detailed information about resumption in the wiki, and hopefully by next week I'll be implementing the jingle FT.

Saturday, June 4, 2011

Starting to implement

So, Gajim can basically send and request acks to a server. I haven't through fully tested it, but I will leave that for latter. Right now I'm focusing on resumption, which is harder because it changes the way Gajim connects to the server if it knows that resumption is accepted by the server.



For efficient acking the specification shows this example:


C: <enable/>
S: <enabled stanzas='5'/>
C: <message/>
C: <message/>
C: <message/>
C: <message/>
C: <message/>
C: <r/>
S: <a h='4'/>
C: <message/>
C: <message/>
C: <message/>
C: <message/>
C: <message/>
C: <r/>
S: <a h='9'/>



Which I find very weird that the server is the one who gets to set the interval in which the requests are sent. Since both, the sever and the client, can send and receive acks at any time, it doesn't makes sense that the server cares or has any say on how often the client sends acks.

So I made the judgment call to ignore this for now and let Gajim decide when it wants to send acks.