|
libfossil
|
#include "internal.h"
Data Fields | |
| struct { | |
| fsl_buffer cardPayload | |
| Card payloads. More... | |
| fsl_buffer emit | |
| fsl_xfer_emit() and friends More... | |
| fsl_buffer hash | |
| Hashing and UUID-fetching buffer. More... | |
| fsl_buffer scratch | |
| Generic scratchpad buffer. More... | |
| fsl_buffer uresp | |
| When using compressed responses, this is where it will store the uncompressed response. More... | |
| } | buf |
| Memory buffers. | |
| fsl_sc * | ch |
| The underlying communication channel. | |
| fsl_sc | chz |
| When using compressed responses, we need a layer of buffer to do the decompression. | |
| struct { | |
| int date | |
| int number | |
| short projCodeMatch | |
| Tells us whether the remote project-code matches this one. More... | |
| int time | |
| } | clientVersion |
| struct { | |
| int protocolVersion | |
| fsl_size_t seqNo | |
| } | clone |
| fsl_xfer_config * | config |
| The configuration object for a given xfer trip. | |
| fsl_cx * | f |
| This object's fossil context. | |
| struct { | |
| unsigned configRcvMask | |
| unsigned configSendMask | |
| bool nextIsPrivate | |
| If true, next "file" received is a private artifact. More... | |
| bool syncPrivate | |
| True to enable syncing private content. More... | |
| char const * zAltPCode | |
| } | flag |
| Various flags. | |
| struct { | |
| unsigned char * aToken [fsl__xfer_max_tokens] | |
| Holds pointers to the individual tokens of b. More... | |
| fsl_size_t aTokLen [fsl__xfer_max_tokens] | |
| Holds the strlen() of each token in aTokens. More... | |
| fsl_buffer b | |
| Holds the current input line. More... | |
| fsl_buffer bRaw | |
| A raw, untokenized copy of b. More... | |
| uint8_t nToken | |
| The number of tokens in use in aToken. More... | |
| } | line |
| One line of sync protocol input, which we tokenize via fsl__xfer_readln() for ease of processing. | |
| fsl_xfer_metrics | n |
| Various counters. | |
| struct { | |
| fsl_stmt gimmeInsert | |
| fsl_stmt igotHasRid | |
| fsl_stmt igotInsert | |
| fsl_stmt remoteUnkUuid | |
| } | q |
| Prepared statements. | |
| int | rc |
| Almost all APIs which deal with this class (A) become no-ops if this is non-0, returning this value instead, and (B) set their result code in this member. | |
| struct { | |
| int clockSkewSeen | |
| Seconds of offset from localhost. More... | |
| int manifestDate | |
| int manifestTime | |
| int releaseVersion | |
| } | remote |
| Info about the remote. | |
| struct { | |
| fsl_buffer loginCard | |
| fsl_size_t nBytes | |
| Number of bytes submitted for the request body. More... | |
| fsl_sha1_cx sha1 | |
| Hash of all request payload content, for generating the sync login card. More... | |
| } | request |
| struct { | |
| int httpCode | |
| int httpVersion | |
| } | response |
| struct { | |
| char const * name | |
| User name memory owned by fsl__xfer::url. More... | |
| char const * password | |
| Password memory owned by fsl__xfer::url. More... | |
| char * passwordToFree | |
| Password memory owned by this object. More... | |
| fsl_uperm perm | |
| Permissions calculated for the current user from sync login info. More... | |
| } | user |
| Info about the user which is relevant for sync. | |
Internal state for an ongoing fsl_sync(). Modelled largely after fossil(1)'s xfer.c:Xfer class.
Definition at line 2712 of file internal.h.
| unsigned char* fsl__xfer::aToken[fsl__xfer_max_tokens] |
Holds pointers to the individual tokens of b.
The memory lives in this->b. These are non-const only so that we can use fsl_bytes_defossilize() on them.
Definition at line 2761 of file internal.h.
| fsl_size_t fsl__xfer::aTokLen[fsl__xfer_max_tokens] |
Holds the strlen() of each token in aTokens.
Definition at line 2765 of file internal.h.
| fsl_buffer fsl__xfer::b |
Holds the current input line.
Populated and tokenized by fsl__xfer_readln().
Definition at line 2752 of file internal.h.
| fsl_buffer fsl__xfer::bRaw |
A raw, untokenized copy of b.
Definition at line 2756 of file internal.h.
| struct { ... } fsl__xfer::buf |
Memory buffers.
| fsl_buffer fsl__xfer::cardPayload |
Card payloads.
Definition at line 2783 of file internal.h.
| fsl_sc* fsl__xfer::ch |
The underlying communication channel.
Definition at line 2727 of file internal.h.
| fsl_sc fsl__xfer::chz |
When using compressed responses, we need a layer of buffer to do the decompression.
This object, if populated, is a partial fsl_sc implementation which buffers the whole uncompressed response and only supports reading.
Definition at line 2865 of file internal.h.
| struct { ... } fsl__xfer::clientVersion |
| int fsl__xfer::clockSkewSeen |
Seconds of offset from localhost.
Definition at line 2812 of file internal.h.
| struct { ... } fsl__xfer::clone |
| fsl_xfer_config* fsl__xfer::config |
The configuration object for a given xfer trip.
Its initial state represents the initial request parameters and it may get updated as the sync progresses.
Definition at line 2734 of file internal.h.
| unsigned fsl__xfer::configRcvMask |
Definition at line 2798 of file internal.h.
| unsigned fsl__xfer::configSendMask |
Definition at line 2799 of file internal.h.
| int fsl__xfer::date |
Definition at line 2819 of file internal.h.
| fsl_buffer fsl__xfer::emit |
fsl_xfer_emit() and friends
Definition at line 2785 of file internal.h.
| fsl_cx* fsl__xfer::f |
This object's fossil context.
Errors encountered by the channel should be sent here using fsl_xfer_error() and friends. A channel's impl may use the context for other purposes, e.g. fetching or storing channel-specific configuration info like credentials or using a db-side cache.
f must outlive this object.
Definition at line 2722 of file internal.h.
| struct { ... } fsl__xfer::flag |
Various flags.
| fsl_stmt fsl__xfer::gimmeInsert |
Definition at line 2791 of file internal.h.
| fsl_buffer fsl__xfer::hash |
Hashing and UUID-fetching buffer.
Definition at line 2779 of file internal.h.
| int fsl__xfer::httpCode |
Definition at line 2884 of file internal.h.
| int fsl__xfer::httpVersion |
Definition at line 2883 of file internal.h.
| fsl_stmt fsl__xfer::igotHasRid |
Definition at line 2790 of file internal.h.
| fsl_stmt fsl__xfer::igotInsert |
Definition at line 2789 of file internal.h.
| struct { ... } fsl__xfer::line |
One line of sync protocol input, which we tokenize via fsl__xfer_readln() for ease of processing.
| fsl_buffer fsl__xfer::loginCard |
Definition at line 2875 of file internal.h.
| int fsl__xfer::manifestDate |
Definition at line 2809 of file internal.h.
| int fsl__xfer::manifestTime |
Definition at line 2810 of file internal.h.
| fsl_xfer_metrics fsl__xfer::n |
Various counters.
Definition at line 2867 of file internal.h.
| char const* fsl__xfer::name |
User name memory owned by fsl__xfer::url.
Definition at line 2842 of file internal.h.
| fsl_size_t fsl__xfer::nBytes |
Number of bytes submitted for the request body.
Definition at line 2879 of file internal.h.
| bool fsl__xfer::nextIsPrivate |
If true, next "file" received is a private artifact.
Definition at line 2804 of file internal.h.
| uint8_t fsl__xfer::nToken |
The number of tokens in use in aToken.
Definition at line 2767 of file internal.h.
| int fsl__xfer::number |
Definition at line 2818 of file internal.h.
| char const* fsl__xfer::password |
Password memory owned by fsl__xfer::url.
Definition at line 2846 of file internal.h.
| char* fsl__xfer::passwordToFree |
Password memory owned by this object.
Gets extracted from the repo.user table if no password is otherwise provided.
Definition at line 2851 of file internal.h.
| fsl_uperm fsl__xfer::perm |
Permissions calculated for the current user from sync login info.
Definition at line 2857 of file internal.h.
| short fsl__xfer::projCodeMatch |
Tells us whether the remote project-code matches this one.
If not, some operations won't work (like logging in - that only works when project codes match because the project code is part of the password hash).
Values: <0=unknown, 0=mismatch, >0=match.
Definition at line 2829 of file internal.h.
| int fsl__xfer::protocolVersion |
Definition at line 2832 of file internal.h.
| struct { ... } fsl__xfer::q |
Prepared statements.
| int fsl__xfer::rc |
Almost all APIs which deal with this class (A) become no-ops if this is non-0, returning this value instead, and (B) set their result code in this member.
This simplifies some internals by allowing us to forego explicit error checks when making multiple xfer-related calls in a row.
Definition at line 2743 of file internal.h.
| int fsl__xfer::releaseVersion |
Definition at line 2808 of file internal.h.
| struct { ... } fsl__xfer::remote |
Info about the remote.
| fsl_stmt fsl__xfer::remoteUnkUuid |
Definition at line 2793 of file internal.h.
| struct { ... } fsl__xfer::request |
| struct { ... } fsl__xfer::response |
| fsl_buffer fsl__xfer::scratch |
Generic scratchpad buffer.
Definition at line 2781 of file internal.h.
| fsl_size_t fsl__xfer::seqNo |
Definition at line 2833 of file internal.h.
| fsl_sha1_cx fsl__xfer::sha1 |
Hash of all request payload content, for generating the sync login card.
Definition at line 2874 of file internal.h.
| bool fsl__xfer::syncPrivate |
True to enable syncing private content.
Definition at line 2802 of file internal.h.
| int fsl__xfer::time |
Definition at line 2820 of file internal.h.
| fsl_buffer fsl__xfer::uresp |
When using compressed responses, this is where it will store the uncompressed response.
We decompress it on behalf of the fsl_sc so that those impls don't have to all do this on their own.
Definition at line 2777 of file internal.h.
| struct { ... } fsl__xfer::user |
Info about the user which is relevant for sync.
| char const* fsl__xfer::zAltPCode |
Definition at line 2800 of file internal.h.