Permalink
Commits on Apr 1, 2012
  1. Support multipart GETs of documents

    Another missing router feature that broke replication.
    Also made TDMultipartDocumentReader not fail if the document contains no attachments.
    Also added some more warnings/logging.
    snej committed Apr 1, 2012
Commits on Mar 30, 2012
  1. Fixed a race condition in the HTTP listener

    Sometimes it would never send the body of a response or close the socket.
    I saw this happen with error responses like 404s; not sure it it would happen otherwise.
    snej committed Mar 30, 2012
  2. Add router support for PUT of document in MIME multipart format

    This is necessary for allowing TouchDB to be pushed to by another server.
    snej committed Mar 30, 2012
Commits on Mar 29, 2012
  1. Fixed some issues with EOF handling in the updated TDSocketChangeTrac…

    …ker.
    
    The recent changes to do async parsing didn't handle EOF correctly — the tracker shouldn't stop until *after* any pending parse finishes.
    snej committed Mar 29, 2012
  2. Added +[TDJSON appendDictionary:toJSONDictionaryData:].

    Replaces the static function appendDictToJSON in TDDatabase.m.
    
    Also, unrelatedly, added _local_seq to the list sSpecialKeysToRemove in encodeDocumentJSON:.
    snej committed Mar 29, 2012
Commits on Mar 28, 2012
  1. Add GET handler for _session

    Send back an "Admin Party"-like response on a GET
    request to /_session. This makes CouchApps work
    that rely on _session (like Mobile Futon).
    
    Based on vmx's commit to the Android repo:
    vmx/TouchDB-Android@7509e3e
    snej committed Mar 28, 2012
  2. implemented TDNoBody content option and use it for GET attachment

    When getting an attachment via the REST API, avoid loading the document JSON data.
    
    Based on Marty's commit to TouchDB-Android:
    couchbaselabs/TouchDB-Android@6cc2407
    snej committed Mar 28, 2012
  3. Optimization to -forceInsert:revisionHistory:source:

    Don't waste time looking for previous revisions of a document, if the document's ID wasn't even in the database already.
    This makes a difference during pull replications.
    snej committed Mar 28, 2012
  4. Async parsing of continuous _changes feed

    TDSocketChangeTracker parses batches of lines on a background thread.
    It doesn't read more data from the stream until parsing has finished.
    This adds parallelism, and also makes the stream buffering work a lot better because data isn't read until it's ready to be parsed.
    snej committed Mar 28, 2012
  5. Added TDJSON, to abstract our use of NSJSONSerialization and make it …

    …easier to replace
    
    While I was at it, I added the ability to write fragments, and to encode directly to an NSString.
    snej committed Mar 28, 2012
  6. Suppress logging of 404 status reading remote checkpoint doc during r…

    …eplication
    
    This status is expected if it's the first time replicating this pair of databases, so having it show up in the log output makes it look as though there's a problem when there isn't.
    snej committed Mar 28, 2012
  7. Merge pull request #54 from lambmj/master

    Guard against failed read in TDSocketChangeTracker.
    snej committed Mar 28, 2012
  8. Protect against a failed read.

    lambmj committed Mar 28, 2012
Commits on Mar 27, 2012
  1. Updated FMDB

    snej committed Mar 27, 2012
  2. Fixes for TDSocketChangeTracker

    * Work around apparent CFNetwork bug(?) connecting to hostname "localhost" -- substitute "127.0.0.1" instead.
    * The retry behavior wasn't working because it called -stop before retrying, which told the delegate the tracker failed. Fixed.
    * Support the more efficient stream -getBuffer:length: method, even though it doesn't seem to be enabled.
    snej committed Mar 27, 2012
Commits on Mar 26, 2012
  1. Tweaked replicator logging.

    snej committed Mar 26, 2012
  2. Enable SQLite "write-ahead log" to improve performance

    This definitely improves performance of bulk writes, i.e. during the initial pull of a remote database.
    snej committed Mar 26, 2012
  3. Further pull optimizations, & improvements to TDSocketChangeTracker

    * TDPuller now always uses the continuous-mode _changes feed so it can receive the changes individually. That way it can start fetching revisions before the _changes feed completes, which makes a big difference in the initial pull of a database.
    * TDSocketChangeTracker still had the bug where it didn't work on URLs without an explicit port (it wasn't defaulting to port 80). This was fixed a while back in CouchCocoa but not in TouchDB itself.
    * Change lines could be spread across two HTTP chunks, and the parser didn't handle that.
    * Optimized the chunk parser to reduce the amount of memory copying (this was a hot-spot on iOS devices.)
    snej committed Mar 26, 2012
  4. Memory leak fixes & optimizations

    snej committed Mar 26, 2012
Commits on Mar 24, 2012
  1. Optimize pull by fetching single-revision documents in bulk

    If a document to be pulled has only a single revision (revID prefixed "1-"), it has no revision history, so we don't need to fetch it individually.
    Instead we can group these together and get them in one request by POSTing to _all_docs.
    This is a major speedup in the initial pull of some large databases with small single-revision documents (like the "bitcoin" db).
    snej committed Mar 24, 2012
Commits on Mar 23, 2012
  1. More threading fixes.

    * Call NSURLProtocolClient on the URL-loader thread, otherwise responses get dropped sometimes.
    * -[TDRouter stop] wasn't thread-safe.
    * Don't need to queue a block to start the TDReplicatorManager; put it right in -runServerThread.
    snej committed Mar 23, 2012
  2. Make build work with logging disabled (MY_DISABLE_LOGGING)

    Also restored the Info.plist file for the empty app, which had gone missing somehow.
    snej committed Mar 23, 2012
Commits on Mar 22, 2012
  1. Redo threading, again (this time without NSOperationQueue)

    Changed TDServer to TDDatabaseManager, and made a new TDServer that just manages threading. It runs a background thread and schedules blocks on it. There is no access to the TDDatabaseManager except via the thread-safe async calls.
    Tested on Mac OS X 10.7.3 and iOS 5.1.
    snej committed Mar 22, 2012
  2. Revert "Use NSOperationQueue to single-thread access to TDServer/Data…

    …base."
    
    This reverts commit d111a9f.
    
    Conflicts:
    
    	Listener/TDHTTPResponse.m
    	Source/ChangeTracker/TDChangeTracker.m
    	Source/ChangeTracker/TDRemoteRequest.m
    	Source/TDURLProtocol.m
    snej committed Mar 22, 2012
Commits on Mar 21, 2012
  1. Little trivial changes

    snej committed Mar 21, 2012
  2. Don't use NSURLConnection delegate-based API on main thread

    It hangs on iOS, for some reason.
    Fixes #51.
    snej committed Mar 21, 2012
  3. Fixed an infinite loop indexing views

    Regression introduced by c251be3. Occurs if the db contains a design document.
    snej committed Mar 21, 2012
Commits on Mar 20, 2012
  1. Pull all conflicting revisions from remote db during sync

    Adds "?style=all_docs" option to _changes feed.
    snej committed Mar 20, 2012
  2. Fixed race conditions & other bugs in the HTTP listener.

    I had to use @synchronized. I feel so dirty.
    snej committed Mar 20, 2012
  3. TDPusher should transmit properties of deleted revisions

    ...because it's now possible to create a deleted revision that still has properties in it.
    This now fixes #50.
    snej committed Mar 20, 2012
  4. Bump version to 0.69

    and unrelatedly, added a helpful comment in TDPuller.m.
    snej committed Mar 20, 2012