Gajim - 2015-10-14


  1. tmolitor mt, sorry...I had something else to do...the code should run now...the updated version is here: https://paste.gajim.org/view/98b1c1f6
  2. tmolitor mt, and thanks for your help so far!!!
  3. tmolitor arune: strange bug this guy sent via mail...let's wait if I can reproduce it...
  4. tmolitor arune: yes, using the new prosody module the url_image_preview head request doesn't seem to work anymore...I won't get previews, even for old files...
  5. tmolitor arune: I get "File size too big or unknown for URL"
  6. tmolitor mt, the last pastebin had a bug...here is the newest version: https://paste.gajim.org/view/83a97019
  7. tmolitor arune: the new prosody module sends the wrong http header...it sends "Content-Size" instead of the correct "Content-Length" header...
  8. tmolitor arune: I contacted the author of the prosody plugin...
  9. mt tmolitor: glad i can be of service
  10. mt tmolitor: maybe you fixed the bug because i can't reproduce anymore, i've tried 3 times
  11. mt tmolitor: https://paste.gajim.org/view/a456d977
  12. arune tmolitor: great work, thanks
  13. tmolitor Mt, that's strange... I'll look into IT later...
  14. mt tmolitor: i'll try to reproduce later
  15. tmolitor Mt, ok...thanks...
  16. tmolitor mt, I looked at my changes and they are only debug outputs...I didn't change anything else...here is the diff: diff -r a6efe8973330 httpupload/httpupload.py --- a/httpupload/httpupload.py Tue Oct 13 00:19:12 2015 +0200 +++ b/httpupload/httpupload.py Wed Oct 14 14:42:28 2015 +0200 @@ -70,6 +70,7 @@ def handle_agent_info_received(self, event): global jid_to_servers + log.info("httpupload: agent_info: %s" % str(event.stanza)) if NS_HTTPUPLOAD in event.features and gajim.jid_is_transport(event.jid): own_jid = gajim.get_jid_without_resource(str(event.stanza.getTo())) jid_to_servers[own_jid] = event.jid # map own jid to upload component's jid @@ -85,6 +86,11 @@ global last_info_query self.chat_control = control # query info at most every 300 seconds (5 minutes) in case something goes wrong + log.info("httpupload: account not in last_info_query: %s" % str(not self.chat_control.account in last_info_query)) + if self.chat_control.account in last_info_query: + log.info("httpupload: last info query: %s < %s" % (str(last_info_query[self.chat_control.account] + 300), str(time.time()))) + log.info("httpupload: account jid not in jid_to_servers: %s" % str(not gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers)) + log.info("httpupload: gajim account connected: %s" % str(gajim.account_is_connected(self.chat_control.account))) if (not self.chat_control.account in last_info_query or \ last_info_query[self.chat_control.account] + 300 < time.time()) and \ not gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ @@ -107,6 +113,7 @@ queryNS="http://jabber.org/protocol/disco#info" ) iq.setID(id_) + log.info("httpupload: sending discovery iq: %s" % str(iq)) gajim.connections[control.account].connection.send(iq) last_info_query[self.chat_control.account] = time.time() iq_ids_to_callbacks[str(id_)] = query_info @@ -354,6 +361,9 @@ xhtml = '<body><br/><a href="%s"> <img alt="%s" src="data:image/png;base64,%s"/> </a></body>' % \ (get.getData(), get.getData(), thumb) progress_window.close_dialog() + id_ = gajim.get_an_id() + def add_oob_tag(): + pass self.chat_control.send_message(message=get.getData(), xhtml=xhtml) self.chat_control.msg_textview.grab_focus() else: @@ -391,7 +401,7 @@ is_supported = gajim.get_jid_from_account(self.chat_control.account) in jid_to_servers and \ gajim.connections[self.chat_control.account].connection != None - log.debug("jid_to_servers of %s: %s ; connection: %s" % (gajim.get_jid_from_account(self.chat_control.account), str(jid_to_servers[gajim.get_jid_from_account(self.chat_control.account)]), str(gajim.connections[self.chat_control.account].connection))) + log.info("jid_to_servers of %s: %s ; connection: %s" % (gajim.get_jid_from_account(self.chat_control.account), str(jid_to_servers[gajim.get_jid_from_account(self.chat_control.account)]), str(gajim.connections[self.chat_control.account].connection))) if not is_supported: progress_window.close_dialog() log.error("upload component vanished, account got disconnected??")
  17. tmolitor mt, look at my last message, I didn't change anything in the code, so you should still be able to reproduce the bug...
  18. tmolitor arune: what do you suggest for this self signed certificate thing? in my opinion users should either get their certificate from startssl.com or from november on from letsencrypt or create their own ca and deploy it to all devices where they want to use their certificate...
  19. arune tmolitor: not sure about the consequences of downloading images from non trustworthy sources
  20. arune I guess the plugin downloads even from http and nobody expects https
  21. tmolitor arune: the concequences are bad....not only privacy issues but there are enough jpeg exploits out there, too...
  22. tmolitor and in my opinion there are enough alternatives to self signed certificates...
  23. arune But the receiver does not decide anyway
  24. arune The sender could be using http aswell
  25. mt tmolitor: https://paste.gajim.org/view/a6b55e38
  26. mt tmolitor: looks like i've messed up my testing methodology earlier
  27. mt tmolitor: i can only trigger the bug when a message window is open
  28. tmolitor Arune: IT would be good to have an Option to allow Or deny self signed certs as well as an Option to disable fetching of http or ftp URLs...
  29. tmolitor And we really should only fetch Images coming from Users in our roster...
  30. arune tmolitor: could the old version get images from sites with self signed certs?
  31. tmolitor Arune: I don't know...we didn't change the Download Code (apart Form the timeouts) so I would suspect IT couldn't Download them either...
  32. tmolitor I think urllib2 Checks the certificate by default...
  33. mt tmolitor: found anything in my last paste ? need something else ?
  34. tmolitor mt, I came home just now...I'm looking at it in a moment :)
  35. tmolitor arune: here it is: https://www.python.org/dev/peps/pep-0476/ certificate validation is enabled by default in urllib2 since about 28-August-2014...so we didn't change anything regarding this :)
  36. tmolitor arune: okay, I replied to the email with the certificate validation not working "bug", you are in cc...
  37. tmolitor mt, yes, the message windows has to be open to trigger this bug I think...
  38. tmolitor mt, okay, I know why this happened for you...your httpupload component has no own component jid but is included in the main server component...
  39. tmolitor mt, try if that fixes it for you: https://paste.gajim.org/view/816b66aa
  40. tmolitor mt, sadly my component has an own jid, so your bug is not the same as my bug :(
  41. arune tmolitor: maybe the suggested workaround (with context) is implemented in the download function and the new problem is in the HEAD request
  42. mt tmolitor: yep that fixed it, although the message window has to be closed and reopened
  43. tmolitor Mt, IT should work without the close reopen cycle...