Hi, great, I'm glad you moved to papyon! This will be a lot less hassle to you and to others since it's one code everyone shares! It will also be helpful for amsn2 since amsn2 is based on papyon.
Yes, unfortunately, there is no file transfer support at the moment.. however lfrb started working on that already, you can find his code here :
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=summaryYou'll have to checkout the 'direct' branch to get the file transfer support code.. however, I reviewed his code once and it was not yet ready to be merged, it has quite a few issues, so if you want to work on this, you should fix them first...
Here is my review of the code as I posted it originally in the #papyon channel on IRC... I wrote it in french because lfrb speaks french, sorry :
Sep 10 14:31:18 <KaKaRoTo-KS> lfrb,
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=e9dc6ecdf54b5a6433e1b16c29d74fcbcc03423fSep 10 14:31:23 <KaKaRoTo-KS> pkoi c'est 'global'?
Sep 10 14:31:28 <KaKaRoTo-KS> pkoi c'est pas dans TLPHeader ?
Sep 10 14:35:07 <KaKaRoTo-KS> lfrb, je viens de me rendre compte de quelquechose.. je crois que les requetes 'transreq' c'est pas TransferRequest, mais plutot TransportRequest.. non? tu en penses quoi ?
Sep 10 14:43:50 * luckyluke_ has quit (Remote closed the connection)
Sep 10 14:44:45 <KaKaRoTo-KS>
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=4f4f264f91dcf4bcc6a58322440a168817d8fa59Sep 10 14:45:07 <KaKaRoTo-KS> why is the direct p2p transport saying it can handle msnp2p switchboard messages? :|
Sep 10 14:45:07 <KaKaRoTo-KS> + def _can_handle_message(message, switchboard_client=None):
Sep 10 14:47:03 <KaKaRoTo-KS> the code in
Sep 10 14:47:03 <KaKaRoTo-KS> + def _open_listener(self):
Sep 10 14:47:06 <KaKaRoTo-KS> doesn't make much sense..
Sep 10 14:47:36 <KaKaRoTo-KS> why increment port when you're just creating the socket (and fail) since 'port' doesn't have anything to do with the socket creation...
Sep 10 14:47:49 <KaKaRoTo-KS> also, why close the socket, why not retry the bind on the next port and that's it ?
Sep 10 14:58:17 <KaKaRoTo-KS> lfrb, ton direct transport ne verifie pas que tu recois bien un 'foo'
Sep 10 14:59:04 <KaKaRoTo-KS> et le nonce, il verifie pas s'il est correct.. .(s'il est pas correct, sa emet pas de connected, mais ca emettra jamais de failed)
Sep 10 14:59:31 <KaKaRoTo-KS> le timeout de 5 secondes, doit etre fait dans le transport manager, parceque si tu reussi pas a t'authentifier, il devra switcher au switchboard
Sep 10 14:59:57 <KaKaRoTo-KS> (ou quelconque autre error.. meme dans l'echange de INVITE/200 OK du transreq...)
Sep 10 15:00:32 <KaKaRoTo-KS> tu verifie chunk.get_nonce() mets tu lui fait pas .upper() (tu le fais avant, mais tu utilise pas la valeur de retour)
Sep 10 15:03:36 <KaKaRoTo-KS> et puis tu utilise self.__foo pour dire 'foo sent' et 'foo received'...
Sep 10 15:04:13 <KaKaRoTo-KS> si tu recois quelquechose avant que tu n'ait eu le temps d'envoyer le 'foo', ca risque de te faire skipper le premier chunk (et une erreur, une fois que tu aura fixer le code pour que ca verifie bien le contenu du foo packet)
Sep 10 15:05:19 <KaKaRoTo-KS>
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=7c2d3288ad9290d4eb4f7500f1e4b3bcce3b497eSep 10 15:05:47 <KaKaRoTo-KS> tu mets un timeout de 5 secondes pour upnp... alors que ton transport manager devrait failer et utiliser le switchboard apres 5 secondes..
Sep 10 15:05:55 <KaKaRoTo-KS> faudrait pas que ca soit plus de 200ms a mon avis
Sep 10 15:06:46 <KaKaRoTo-KS> il y'a aussi bcps de trucs hardcoded (le initial port a 6891, le 'user-agent' pour le upnp description...)
Sep 10 15:11:04 <KaKaRoTo-KS> lfrb,
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=2373e0ab41a494132cfe54ca345a0f3dff805288Sep 10 15:11:22 <KaKaRoTo-KS> le build_context devrait rajouter 4 * "\xFF" et non pas 4 * "\x00"
Sep 10 15:11:30 <KaKaRoTo-KS> a la fin
Sep 10 15:13:34 <KaKaRoTo-KS> faudrait vraiment revoir ton code, parceque comme tu as pu le remarquer.. y'a bcps trop de trucs incomplets...
Sep 10 15:14:01 <KaKaRoTo-KS> (tu supporte pas te connecter a local + external en meme temps.. tu devrais pouvoir essayer plusieurs connections simultanees)
Sep 10 15:15:06 <KaKaRoTo-KS> tu supporte pas non plus la bonne detection de qui devrait jouer le role de serveur...
Sep 10 15:15:34 <KaKaRoTo-KS> si tu envoie un invite transreq, l'autre user DOIT repondre listening=true
Sep 10 15:15:45 <KaKaRoTo-KS> alors que c'est faux, s'il reponds false, c'est a toi de jouer le role de serveur
Sep 10 15:16:52 <KaKaRoTo-KS> de la meme maniere, qd tu recois un invite transreq, tu dois pas supposer devoir etre listening.. ca depend de ta propre connectivite.. tu dois prendre en compte si tu es firewalled ou pas, c'est quel type de NAT dans lequel tu es.. est ce que upnp fonctionne ou pas, etc... et comparer avec les settings de l'autre user pour pouvoir decider lequel des deux a plus de chance d'avoir un successful connection
Sep 10 15:17:01 <KaKaRoTo-KS> et c'est comme ca que tu determine si tu doit etre listening ou non
Sep 10 15:44:05 * devfil2 (i=4f2af852@gateway/web/freenode/x-skultqupraxqjglt) has joined #papyon
Sep 10 16:04:26 <KaKaRoTo-KS> lfrb, ah, tu devrais aussi updater les copyrights...
Sep 10 16:05:02 <KaKaRoTo-KS> direct p2p file, a un header avec copyright ali sabil, alors que c'est toi qui a ecrit le fichier.. donc enleve le des fichiers que tu as creer toi meme (sip/media/webcam/direct..)
Sep 10 16:05:08 <KaKaRoTo-KS> et rajoute toi sur les fichiers que tu as modifie
Sep 10 16:05:56 <billiob> lfrb: c'est le moment de devenir célèbre

Sep 10 16:06:16 <KaKaRoTo-KS> (et rajoute moi aussi sur webcam/p2p/session parceque j'ai pas pense a le faire qd j'ai modifie ces fichiers la)
Sep 10 16:06:20 <KaKaRoTo-KS> billiob, yo

Sep 10 16:06:39 <billiob> KaKaRoTo-KS: salut

Sep 10 16:06:52 <KaKaRoTo-KS> on dirait que les frenchies ont pris ce channel d'assaut aussi

Sep 10 16:07:32 <KaKaRoTo-KS> sur 11 personnes, il y'a 9 frenchies, et 2 non-french... :p
Sep 10 16:17:53 * arantes (n=arantes@41.250.123.92) has joined #papyon
Sep 10 16:20:19 <KaKaRoTo-KS> 12 personnes.. 10 frenchies... :p
Sep 10 16:20:40 <KaKaRoTo-KS> arantes, safi, fterti? :@
Here is a quick translation :
Sep 10 14:31:18 <KaKaRoTo-KS> lfrb,
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=e9dc6ecdf54b5a6433e1b16c29d74fcbcc03423fSep 10 14:31:23 <KaKaRoTo-KS> why is it 'global' ?
Sep 10 14:31:28 <KaKaRoTo-KS> and why isn't it in TLPHeader ?
Sep 10 14:35:07 <KaKaRoTo-KS> lfrb, I just realized something.. I think that the request 'transreq' isn't TransferRequest, but instead is TransportRequest.. what do you think ?
Sep 10 14:44:45 <KaKaRoTo-KS>
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=4f4f264f91dcf4bcc6a58322440a168817d8fa59Sep 10 14:45:07 <KaKaRoTo-KS> why is the direct p2p transport saying it can handle msnp2p switchboard messages? :|
Sep 10 14:45:07 <KaKaRoTo-KS> + def _can_handle_message(message, switchboard_client=None):
Sep 10 14:47:03 <KaKaRoTo-KS> the code in
Sep 10 14:47:03 <KaKaRoTo-KS> + def _open_listener(self):
Sep 10 14:47:06 <KaKaRoTo-KS> doesn't make much sense..
Sep 10 14:47:36 <KaKaRoTo-KS> why increment port when you're just creating the socket (and fail) since 'port' doesn't have anything to do with the socket creation...
Sep 10 14:47:49 <KaKaRoTo-KS> also, why close the socket, why not retry the bind on the next port and that's it ?
Sep 10 14:58:17 <KaKaRoTo-KS> lfrb, your direct transport doesn't verifie that you received 'foo'
Sep 10 14:59:04 <KaKaRoTo-KS> and it doesn't verify if the nonce is correct.. if it's not connect, it doesn't emit a 'connected' signal but it will never emit a 'failed' signal ever
Sep 10 14:59:31 <KaKaRoTo-KS> the 5 secondes timeout must be done in the transport manager because if you can't authenticate it should use the switchboard
Sep 10 14:59:57 <KaKaRoTo-KS> (or whatever other error, even in the exchange of the INVITE/200 OK of transreq...)
Sep 10 15:00:32 <KaKaRoTo-KS> you verify chunk.get_nonce() but you don't do upper() (you do it before but you ignore the return value)
Sep 10 15:03:36 <KaKaRoTo-KS> and you use self.__foo to say 'foo sent' and 'foo received'...
Sep 10 15:04:13 <KaKaRoTo-KS> if you receive something before getting the time to send 'foo', it could make you skip the first chunk (and an error once you fix the code to check the content of the foo packet)
Sep 10 15:05:19 <KaKaRoTo-KS>
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=7c2d3288ad9290d4eb4f7500f1e4b3bcce3b497eSep 10 15:05:47 <KaKaRoTo-KS> you put a 5 secondes timeout for upnp... while your transport manager should fail and fallback on using the switchboard after 5 seconds!
Sep 10 15:05:55 <KaKaRoTo-KS> I think that timeout shouldn't be more than 200ms
Sep 10 15:06:46 <KaKaRoTo-KS> there are also a lot of hardcoded values (like the initial port set to 6891, the 'user-agent' for the upnp description...)
Sep 10 15:11:04 <KaKaRoTo-KS> lfrb,
http://git.collabora.co.uk/?p=user/lfrb/papyon/.git;a=commitdiff;h=2373e0ab41a494132cfe54ca345a0f3dff805288Sep 10 15:11:22 <KaKaRoTo-KS> the build_context should add 4 * "\xFF" not 4 * "\x00"
Sep 10 15:11:30 <KaKaRoTo-KS> at the end
Sep 10 15:13:34 <KaKaRoTo-KS> you should review all your code yourself because as you noticed there are a lot of issues with it
Sep 10 15:14:01 <KaKaRoTo-KS> (you don't support to connect to local + external at the same time.. you should try to connect to multiple sockets simultanuously)
Sep 10 15:15:06 <KaKaRoTo-KS> you also don't support the correct detection of who should act as a server
Sep 10 15:15:34 <KaKaRoTo-KS> if you send a transreq invite, the other user MUST reply with listening=true
Sep 10 15:15:45 <KaKaRoTo-KS> which is not true, if it answers false, you should act as a server instead
Sep 10 15:16:52 <KaKaRoTo-KS> similarly, if you receive a transreq, you shouldn't suppose you'll be listening, it depends on your connectivity, you should take into account whether you are firewalled or not, which type of NAT you are behind, whether upnp worked or not, and compare your settings with the ones from the other user in order to decide which one of you has the most change in having a successful connection
Sep 10 15:17:01 <KaKaRoTo-KS> that's how you determine if you should be listening or not
Sep 10 16:04:26 <KaKaRoTo-KS> lfrb, ah, you should also update the copyrights...
Sep 10 16:05:02 <KaKaRoTo-KS> direct p2p file, has a copyright header by ali sabil, but you're the one who wrote that file.. so remove him from the files you wrote (sip/media/webcam/direct..)
Sep 10 16:05:08 <KaKaRoTo-KS> and add yourself to the files you modified
Sep 10 16:06:16 <KaKaRoTo-KS> (and add me too to the webcam/p2p/session because I didn't think of doing it when i modified those files)
ok.. that's a pretty rough and quick translation but it should give you enough comments to get you started and so you know what is missing in that code and in case you test it and it fails, why it failed... I hope it's useful to you!
I hope you can get this fixed and I'll be happy to review your code once you're done fixing lfrb's branch!
Good luck!
