Commits on Dec 20, 2012
  1. Replicator now proactively sends auth credentials on every request.

    I think this will fix the remaining Cloudant errors (timeout / socket-closed errors pushing large docs).
    Speculatively fixes #185.
    snej committed Dec 20, 2012
Commits on Dec 14, 2012
Commits on Dec 13, 2012
  1. Fix an assertion failure in TDSocketChangeTracker

    -start should just return NO if called when tracker is already running.
    Fixes #196.
    snej committed Dec 13, 2012
  2. Fix unnecessary 401 challenges

    MYURLUtils' method -my_credentialForRealm: is returning a credential with no persistence
    when the URL has a baked-in username and password. This turns out to prevent NSURLConnection
    from proactively sending the same credential on the next connection to the host, with the bad
    effect that every connection initially gets a 401 and only then gets the credential and retries. This
    slows down performance.
    Fixed this by changing the persistence to NSURLCredentialPersistenceForSession.
    I believe this fixes #197 in TouchDB.
    snej committed Dec 13, 2012
  3. Better retry behavior on failure to get password from keychain

    For some reason TDSocketChangeTracker sometimes fails to get the password of the credential it's just looked up.
    Added some fallback code to make a second attempt to reload the credential.
    Also, if it fails to get the password it will clear the busted credential so that it can try to look it up again when it gets
    the 401 response.
    Fixes #195 ... I hope?
    snej committed Dec 13, 2012
Commits on Dec 12, 2012
  1. Make direct PUT to attachment URL work with streamed request body

    This case was accidentally not fixed back in commit 7f24896.
    Fixes #198.
    snej committed Dec 12, 2012
Commits on Dec 5, 2012
  1. Bump project version # to 1.001

    snej committed Dec 5, 2012
Commits on Dec 3, 2012
  1. Avoid race condition registering filters on startup

    It was possible for a persistent push replication to start running on  startup before the app had a chance to install filter blocks.
    This meant the replication would ignore the filter and send all documents, which is pretty bad.
    * Changed TDPusher to make a missing filter function an error.
    * Changed TD_Server to wait till the next runloop iteration to start the replicator, giving the caller time to set up filters and validations.
    Fixes #193.
    snej committed Dec 3, 2012
Commits on Nov 16, 2012
  1. -[TD_Server close] should be synchronous

    Closing the server at app quit time is currently a race condition because the -close call returns before the server thread has finished closing stuff, so the process might exit before it finishes. Fixed this by making the -close call synchronous. (Related to #189.)
    snej committed Nov 16, 2012
  2. Improve _compact to clear out SQLite WAL file

    _compact wasn't really freeing space (at least not immediately) because the changes got appended to the SQLite write-ahead log file. So I extended the -compact method by having it issue a SQL pragma to flush the WAL, and then close and re-open the database. This resets the "___.touchdb-wal" file to zero length.
    Fixes #189.
    snej committed Nov 16, 2012
Commits on Nov 15, 2012
  1. Fix crash after resuming pull due to location change

    Shouldn't create a new _pendingChanges when resuming activity, or it'll be out of sync with the _batcher.
    (Found by @tleyden; see his patch in #190.)
    Fixes #188.
    snej committed Nov 15, 2012
  2. Updated MYUtilities

    snej committed Nov 15, 2012
Commits on Nov 14, 2012
  1. Allow client to reset replication state

    Setting the "reset" property in a replication request will cause the local checkpoint to be erased, meaning the next replication will start over from scratch (sequence 0).
    The Mac demo app now has a menu item that exercises this.
    Fixes #186.
    snej committed Nov 14, 2012
  2. Better error if a pushed document fails to be saved

    If remote _bulk_docs indicates an error saving a document,
    (a) Map "unauthorized" message to 401 status (instead of default 502)
    (b) Put the document's URL in the NSError object's userInfo.
    snej committed Nov 14, 2012
Commits on Nov 8, 2012
  1. Minor ARC fix in the unit tests

    The test files weren't being built with ARC in the iOS demo target.
    snej committed Nov 8, 2012
  2. Mass renaming of "TD" classes to "TD_"

    Preparing for the public API which will have non-underscored names;
    for instance, TDDatabase will be the public class, while the existing internal
    class is TD_Database.
    snej committed Nov 7, 2012
Commits on Nov 6, 2012
Commits on Nov 5, 2012
  1. Updated README for version 1.0.

    snej committed Nov 5, 2012
  2. Bump version to 1.0!!

    snej committed Nov 5, 2012
Commits on Nov 2, 2012
  1. ARC-ify TouchServ.m

    snej committed Nov 2, 2012
  2. Updated MYUtilities.

    snej committed Nov 2, 2012
  3. Converted to ARC.

    Merged, and more fixes added, by Jens.
    mz2 committed with snej Sep 30, 2012
Commits on Oct 31, 2012
  1. Optimize reduced/grouped queries through lazy parsing

    Avoid parsing the keys and values from the index unless it's necessary.
    This can speed up some queries a lot, if the reduce function doesn't access the keys or the values.
    snej committed Oct 31, 2012
Commits on Oct 30, 2012
  1. Fixed an exception in the iOS demo's validation function

    It would raise an exception if the "created_at" property of a doc was a non-string.
    snej committed Oct 30, 2012
  2. Increase max number of puller connections from 4 to 12

    This was lowered from 8 to 4 a month ago by commit facc703, but
    (a) that had a pretty major hit on performance, and
    (b) I think the bug that fixed was actually caused by the _changes feed deadlock I just eliminated by restoring TDSocketChangeTracker.
    snej committed Oct 30, 2012
Commits on Oct 29, 2012
  1. Fix incorrect _changes entry after attachment update

    Direct PUT or DELETE of an attachment was sending an incorrect notification to
    pending _changes feeds that had include_docs -- the doc body was missing the _attachments property.
    Fixes #180.
    snej committed Oct 29, 2012
Commits on Oct 27, 2012
  1. The return of TDSocketChangeTracker

    * Fixes #177: Using it instead of TDConnectionChangeTracker to get around running out of sockets with 5+ replications active at once. (Also fixes #124 since the hostname-munging workaround is no longer needed.)
    * It now uses CFReadStreamCreateForHTTPRequest.
    * It now supports one-shot and long-poll modes, not just continuous.
    snej committed Oct 26, 2012
Commits on Oct 25, 2012
  1. Avoid intermittent crash after stopping TDPuller

    If a TDPuller remote request completes after the puller's been stopped,
    avoid trying to send more requests, since the database connection is gone.
    Fixes #179
    snej committed Oct 25, 2012
  2. TDConnectionChangeTracker should honor a username in the URL

    When looking up an auth credential, use the username in the URL if present.
    This will prevent trying to use the wrong credentials if another username exists
    in the keychain/credential store.
    snej committed Oct 25, 2012
Commits on Oct 17, 2012
  1. Really fix edge case where TDPuller never stops if told to stop befor…

    …e it catches up
    There was a second place in the code where I needed to make the same change,
    to make the fix really work...
    Fixes #169 (I hope, again)
    snej committed Oct 17, 2012
Commits on Oct 15, 2012
  1. Fix edge case where TDPuller never stops if told to stop before it ca…

    …tches up
    This in turn was resulting in the puller never re-starting after the app was reactivated.
    Fixes #169 (I hope)
    snej committed Oct 15, 2012