Skip to content

Commit ce67e74

Browse files
jrohellukash
authored andcommitted
Fix: API - LrHandleOption enum - LRO_ONETIMEFLAG (RhBug:1761779)
The commit "Add support for one-time URL flags" introduces the LRO_ONETIMEFLAG option. The new option was inserted into LrHandleOption enum -> all options behind it changed its value (increased by one). API was changed. This patch moves LRO_ONETIMEFLAG option behind existing ones. So, the original values of options are restored.
1 parent 5c30597 commit ce67e74

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

librepo/handle.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -143,30 +143,6 @@ typedef enum {
143143
LRO_METALINKURL, /*!< (char *)
144144
Metalink url */
145145

146-
LRO_ONETIMEFLAG, /*!< (char *)
147-
A one-time flag is a URL query parameter (in the form "key=value") that
148-
is added to the first HTTP request for LRO_METALINKURL or
149-
LRO_MIRRORLIST (whichever comes first) made with this handle. Any
150-
subsequent requests with this handle, including any retry attempts made
151-
by librepo internally, will not get the flag.
152-
153-
This is useful for implementing a mechanism for counting the users of a
154-
repository (and, by extension, of the OS as a whole) in which all flags
155-
received by the server in a specific time period are summed up to
156-
produce a good estimate, with the advantage of bundling the flag into
157-
regular metadata updates and not sending separate requests just for
158-
that purpose alone.
159-
160-
The guarantee is that, once set on this handle, the flag will only be
161-
used once and then thrown away (set to NULL). The program may choose
162-
to implement a sliding time window used to set this option on a regular
163-
basis (such as once per week), to allow for gathering usage statistics
164-
over time.
165-
166-
For a reference implementation, see the "countme" option in dnf.conf(5)
167-
or the associated Fedora change:
168-
https://fedoraproject.org/wiki/Changes/DNF_Better_Counting */
169-
170146
LRO_LOCAL, /*!< (long 1 or 0)
171147
Do not duplicate local metadata, just locate the old one */
172148

@@ -398,6 +374,30 @@ typedef enum {
398374
If enabled, librepo will try to keep timestamps of the downloaded files
399375
in sync with that on the remote side. */
400376

377+
LRO_ONETIMEFLAG, /*!< (char *)
378+
A one-time flag is a URL query parameter (in the form "key=value") that
379+
is added to the first HTTP request for LRO_METALINKURL or
380+
LRO_MIRRORLIST (whichever comes first) made with this handle. Any
381+
subsequent requests with this handle, including any retry attempts made
382+
by librepo internally, will not get the flag.
383+
384+
This is useful for implementing a mechanism for counting the users of a
385+
repository (and, by extension, of the OS as a whole) in which all flags
386+
received by the server in a specific time period are summed up to
387+
produce a good estimate, with the advantage of bundling the flag into
388+
regular metadata updates and not sending separate requests just for
389+
that purpose alone.
390+
391+
The guarantee is that, once set on this handle, the flag will only be
392+
used once and then thrown away (set to NULL). The program may choose
393+
to implement a sliding time window used to set this option on a regular
394+
basis (such as once per week), to allow for gathering usage statistics
395+
over time.
396+
397+
For a reference implementation, see the "countme" option in dnf.conf(5)
398+
or the associated Fedora change:
399+
https://fedoraproject.org/wiki/Changes/DNF_Better_Counting */
400+
401401
LRO_SENTINEL, /*!< Sentinel */
402402

403403
} LrHandleOption; /*!< Handle config options */

0 commit comments

Comments
 (0)