-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST listener improvements for liteserv #2117
base: master
Are you sure you want to change the base?
Commits on Sep 6, 2024
-
Fixed UB when a CollectionChangeObserver deletes itself in its callback
The code that calls observers attempted to protect itself from the list being mutated while it was iterating, but apparently it didn't work well enough. I changed the code so it now iterates the list collecting the observer pointers, and then calls them afterwards. While I was debugging this I noticed SequenceTracker doesn't have a logging identifier, so I added it.
Configuration menu - View commit details
-
Copy full SHA for e3f46ff - Browse repository at this point
Copy the full SHA e3f46ffView commit details -
- Fixed a bug where the existing `split` method would report an extra empty string, if the input string ends with the delimiter. - Added a variant of `split` that returns a vector instead of using a callback.
Configuration menu - View commit details
-
Copy full SHA for 124d6b9 - Browse repository at this point
Copy the full SHA 124d6b9View commit details -
TCPSocket: Fixed misleading error message
If a response had neither a Content-Length, Transfer-Encoding nor Connection header, the error would be "Unsupported 'Connection' response header", which is misleading.
Configuration menu - View commit details
-
Copy full SHA for fc77257 - Browse repository at this point
Copy the full SHA fc77257View commit details -
REST: Clean up JSON generation with new Encoder APIs
Use Encoder::writeFormatted to simplify creating JSON. Also used the not-at-all-new `enc["key"] = value` form.
Configuration menu - View commit details
-
Copy full SHA for aefd99b - Browse repository at this point
Copy the full SHA aefd99bView commit details -
Listener: Fixed lock pessimization in Server
Server was locking its mutex while calling a handler. This made it impossible to handle more than one HTTP request at once. Especially bad when handling `/db/_replicate`, whose handler blocks until the replication completes!
Configuration menu - View commit details
-
Copy full SHA for 131b47b - Browse repository at this point
Copy the full SHA 131b47bView commit details -
HTTP: Warn if JSON response is unparseable
Body::bodyAsJSON() would silently return nullptr if the response is supposed to be JSON but fails to parse. This made some test failures hard to track down today! It now logs a warning.
Configuration menu - View commit details
-
Copy full SHA for 1b8a272 - Browse repository at this point
Copy the full SHA 1b8a272View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c3f82e - Browse repository at this point
Copy the full SHA 4c3f82eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e8bce93 - Browse repository at this point
Copy the full SHA e8bce93View commit details -
- Added "Server:" response header - Added "ETag:" response header to document response - Honor "If-None-Match" request header getting document - Added "total_rows" and "update_seq" to _all_docs response - Suppress response body on HEAD request - _changes feed improvements: - Flush output before waiting - No heartbeat if ?heartbeat=0 - Longest possible timeout if ?timeout=0 - Stop on socket error - Make logging verbose not info
Configuration menu - View commit details
-
Copy full SHA for dd2edf5 - Browse repository at this point
Copy the full SHA dd2edf5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b99ef5 - Browse repository at this point
Copy the full SHA 8b99ef5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03280ac - Browse repository at this point
Copy the full SHA 03280acView commit details -
Improved how RequestResponse sends headers
Instead of writing them immediately, save them in a Headers object. That gives client code more flexibility about when it can set headers -- it doesn't have to wait until after the status line is sent.
Configuration menu - View commit details
-
Copy full SHA for 53cce56 - Browse repository at this point
Copy the full SHA 53cce56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 71b403e - Browse repository at this point
Copy the full SHA 71b403eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e834e99 - Browse repository at this point
Copy the full SHA e834e99View commit details -
Configuration menu - View commit details
-
Copy full SHA for 812c3bc - Browse repository at this point
Copy the full SHA 812c3bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for b53e3b4 - Browse repository at this point
Copy the full SHA b53e3b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ec8b81 - Browse repository at this point
Copy the full SHA 6ec8b81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 473d861 - Browse repository at this point
Copy the full SHA 473d861View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ca1274 - Browse repository at this point
Copy the full SHA 6ca1274View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4787ce - Browse repository at this point
Copy the full SHA d4787ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8244f85 - Browse repository at this point
Copy the full SHA 8244f85View commit details -
REST: Write a newline at the end of a continuous-changes line
It doesn't make a difference functionally, but it works around curl not displaying the last line of output.
Configuration menu - View commit details
-
Copy full SHA for 2321296 - Browse repository at this point
Copy the full SHA 2321296View commit details -
Configuration menu - View commit details
-
Copy full SHA for 167f925 - Browse repository at this point
Copy the full SHA 167f925View commit details -
Fixed NotFound error creating BlobStore
Discovered this scenario while testing replications in liteserv: 1. Create an empty database 2. Close it 3. Reopen it without giving the kC4DB_Create flag 4. Access the BlobStore, i.e. call c4Database::getBlobStore() Result: getBlobStore fails with a NotFound error. The reason is that step 1 didn't instantiate the BlobStore or create the Attachments directory; and then in step 4 the db's flags don't include kC4DB_Create so the BlobStore instance won't create the directory. Fixed by passing the kC4DB_Create flag to the C4BlobStore constructor whenever the database is writeable.
Configuration menu - View commit details
-
Copy full SHA for 6609baa - Browse repository at this point
Copy the full SHA 6609baaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b4e795 - Browse repository at this point
Copy the full SHA 1b4e795View commit details -
REST: Refactoring RESTListener+Replicate
- Moved all the request parsing out of the Task class. - One-shot replication does not block response until finished. - Returns 202 Accepted status, not 200. - To cancel a replication you now set the `cancel` property to the `session_id` of the task. - Preliminary support for channel/docID filters, but they're not per-collection yet.
Configuration menu - View commit details
-
Copy full SHA for 055d3a5 - Browse repository at this point
Copy the full SHA 055d3a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3568da9 - Browse repository at this point
Copy the full SHA 3568da9View commit details -
REST: Rudimentary API version checking
Client specifies the version in a header, e.g: API-Version: 1 API-Version: 3.5 If missing, it defaults to 1.0. Handlers support a specific major version, and an incompatible version in a request triggers a 400 response.
Configuration menu - View commit details
-
Copy full SHA for 7a0cfdf - Browse repository at this point
Copy the full SHA 7a0cfdfView commit details -
READ: Added API to tell C4Listener to start a replication
CBL will probably never use this, but liteserv needs it.
Configuration menu - View commit details
-
Copy full SHA for 417effd - Browse repository at this point
Copy the full SHA 417effdView commit details -
Configuration menu - View commit details
-
Copy full SHA for d768e61 - Browse repository at this point
Copy the full SHA d768e61View commit details -
Configuration menu - View commit details
-
Copy full SHA for da7e213 - Browse repository at this point
Copy the full SHA da7e213View commit details -
Configuration menu - View commit details
-
Copy full SHA for b48da47 - Browse repository at this point
Copy the full SHA b48da47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6322ff0 - Browse repository at this point
Copy the full SHA 6322ff0View commit details
Commits on Sep 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b3adc5c - Browse repository at this point
Copy the full SHA b3adc5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a0d5abb - Browse repository at this point
Copy the full SHA a0d5abbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e2d598 - Browse repository at this point
Copy the full SHA 8e2d598View commit details -
REST: Don't use regexes to look up handlers
They're slow, and we only need very simple pattern matching.
Configuration menu - View commit details
-
Copy full SHA for 7173c9a - Browse repository at this point
Copy the full SHA 7173c9aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e920a91 - Browse repository at this point
Copy the full SHA e920a91View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d409a4 - Browse repository at this point
Copy the full SHA 2d409a4View commit details -
REST: Don't get peer address str on every request
Rather, get it when accepting the socket connection and reuse it. Yes, this was actually a significant time-sink, roughly 6% of the time to handle a simple request.
Configuration menu - View commit details
-
Copy full SHA for b6cd702 - Browse repository at this point
Copy the full SHA b6cd702View commit details -
Configuration menu - View commit details
-
Copy full SHA for dad80fa - Browse repository at this point
Copy the full SHA dad80faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d603db - Browse repository at this point
Copy the full SHA 8d603dbView commit details -
REST: Fixed DELETE /db handler
There were issues making it work with the DatabasePool.
Configuration menu - View commit details
-
Copy full SHA for 1ba7b03 - Browse repository at this point
Copy the full SHA 1ba7b03View commit details
Commits on Sep 11, 2024
-
REST: Make server name/version configurable [API change]
Added `serverName`, `serverVersion` to C4ListenerConfig. By default these should be nullslice.
Configuration menu - View commit details
-
Copy full SHA for d44bba8 - Browse repository at this point
Copy the full SHA d44bba8View commit details -
Configuration menu - View commit details
-
Copy full SHA for db2263b - Browse repository at this point
Copy the full SHA db2263bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 63e41ae - Browse repository at this point
Copy the full SHA 63e41aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b9438d - Browse repository at this point
Copy the full SHA 0b9438dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fc76e8 - Browse repository at this point
Copy the full SHA 7fc76e8View commit details