diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | doc/design/assistant/blog/day_114__xmpp.mdwn | 57 | ||||
-rw-r--r-- | doc/design/assistant/xmpp.mdwn | 1 | ||||
-rw-r--r-- | git-annex.cabal | 2 |
6 files changed, 63 insertions, 3 deletions
@@ -16,7 +16,7 @@ all=$(bins) $(mans) docs OS:=$(shell uname | sed 's/[-_].*//') ifeq ($(OS),Linux) -OPTFLAGS?=-DWITH_INOTIFY +OPTFLAGS?=-DWITH_INOTIFY -DWITH_DBUS clibs=Utility/libdiskfree.o Utility/libmounts.o THREADFLAGS=$(shell if test -e `ghc --print-libdir`/libHSrts_thr.a; then printf -- -threaded; fi) else diff --git a/debian/changelog b/debian/changelog index 246c0badc..2278195c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ git-annex (3.20121018) UNRELEASED; urgency=low * bugfix: Don't fail transferring content from read-only repos. Closes: #691341 * configure: Check that checksum programs produce correct checksums. + * Re-enable dbus, using a new version of the library that fixes the memory + leak. -- Joey Hess <joeyh@debian.org> Wed, 17 Oct 2012 14:24:10 -0400 diff --git a/debian/control b/debian/control index 24464f980..ec648288a 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Build-Depends: libghc-edit-distance-dev, libghc-hinotify-dev [linux-any], libghc-stm-dev (>= 2.3), - libghc-dbus-dev [linux-any], + libghc-dbus-dev [linux-any] (>= 0.10.2), libghc-yesod-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64], libghc-yesod-static-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64], libghc-yesod-default-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64], diff --git a/doc/design/assistant/blog/day_114__xmpp.mdwn b/doc/design/assistant/blog/day_114__xmpp.mdwn new file mode 100644 index 000000000..22d9680ac --- /dev/null +++ b/doc/design/assistant/blog/day_114__xmpp.mdwn @@ -0,0 +1,57 @@ +Had to toss out my XMPP presence hack. Turns out that, at least in Google +Talk, presence info is not sent to clients that have marked themselves +unavailable, and that means the assistant would not see notifications, as it +was nearly always marked unavailable as part of the hack. + +I tried writing a test program that uses XMPP personal eventing, only +to find that Google Talk rejected my messages. I'm not 100% sure my +messages were right, but I was directly copying the example in the RFC, +and prosody accepted them. I could not seem to get a list of extensions out +of Google Talk either, so I don't know if it doesn't support personal +eventing, or perhaps only supports certian specific types of events. + +So, plan C... using XMPP [presence extended content](http://xmpp.org/rfcs/rfc6121.html#presence-extended). +The assistant generates a presence message tagged "xa" (Extended Away), +which hopefully will make it not seem present to clients. +And to that presence message, I add my own XML element: + + <git-annex xmlns='git-annex' push="uuid,uuid" /> + +This is all entirely legal, and not at all a hack. +(Aside from this not really being presence info.) Isn't XML fun? + +And plan C works, with Google Talk, and prosody. I've successfully gotten +push notifications flowing over XMPP! + +---- + +Spent some hours dealing with an unusual probolem: git-annex started +segfaulting intermittently on startup with the new XMPP code. + +Haskell code is not supposed to segfault.. + +I think this was probably due to not using a bound thread for XMPP, +so if haskell's runtime system recheduled its green thread onto a different +OS thread during startup, when it's setting up TLS, it'd make gnuTLS very +unhappy. + +So, fixed it to use a bound thread. Will wait and see if the crash is gone. + +---- + +Re-enabled DBUS support, using a new version of the library that avoids the +memory leak. Will need further changes to the library to support +reconnecting to dbus. + +---- + +Next will be a webapp configuration UI for XMPP. Various parts of the +webapp will direct the user to set up XMPP, when appropriate, especially +when the user sets up a cloud remote. + +To make XMPP sufficiently easy to configure, I need to check SRV records to +find the XMPP server, which is an unexpected PITA because `getaddrinfo` +can't do that. There are several haskell DNS libraries that I could use for +SRV, or I could use the `host` command: +`host -t SRV _xmpp-client._tcp.gmail.com` (but don't run that on Solaris, +it changes the hostname..) diff --git a/doc/design/assistant/xmpp.mdwn b/doc/design/assistant/xmpp.mdwn index 6d5384e43..4a05afab9 100644 --- a/doc/design/assistant/xmpp.mdwn +++ b/doc/design/assistant/xmpp.mdwn @@ -4,6 +4,7 @@ who share a repository, that is stored in the [[cloud]]. ### TODO +* Track down segfault when the XMPP library is starting up a client connection. * test with big servers, eg google chat * Prevent idle disconnection. Probably means sending or receiving pings, but would prefer to avoid eg pinging every 60 seconds as some clients do. diff --git a/git-annex.cabal b/git-annex.cabal index a2a89479b..90620f4b3 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -77,7 +77,7 @@ Executable git-annex C-Sources: Utility/libkqueue.c if os(linux) && flag(Dbus) - Build-Depends: dbus + Build-Depends: dbus (>= 0.10.2) CPP-Options: -DWITH_DBUS if flag(Webapp) && flag(Assistant) |