-
Notifications
You must be signed in to change notification settings - Fork 117
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
Preparation for http multi #219
base: main
Are you sure you want to change the base?
Preparation for http multi #219
Commits on Jun 17, 2019
-
Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9af7c5f - Browse repository at this point
Copy the full SHA 9af7c5fView commit details
Commits on Jun 25, 2019
-
casync-http: Rename ARG_PROTOCOL_* to PROTOCOL_*, add a typedef
This is to prepare the next commit, where we will use the protocol enum for more than just the protocol passed in arguments, and the arg_ prefix won't make sense anymore. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 74e294a - Browse repository at this point
Copy the full SHA 74e294aView commit details -
casync-http: Add protocol helpers to factorize code
This commits brings in two helpers: - protocol_str() to convert an enum protocol to a string, which is useful mainly for logs. - protocol_status_ok() as a unique place to check if the protocol status that we get from libcurl means OK or KO. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 10c158c - Browse repository at this point
Copy the full SHA 10c158cView commit details -
casync-http: Use automatic pointer in acquire_file()
Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d7b7bb2 - Browse repository at this point
Copy the full SHA d7b7bb2View commit details -
casync-http: Fix handling of ca_remote_has_unwritten() return value
It seems to me that the condition PROCESS_UNTIL_WRITTEN is reached when there's no more data to write, hence ca_remote_has_unwritten() returns 0. And it also seems that this is could be copy/paste mistake, as all the code above is similar, but the condition matches the function we call, ie: - PROCESS_UNTIL_CAN_PUT_CHUNK > ca_remote_can_put_chunk - PROCESS_UNTIL_CAN_PUT_INDEX > ca_remote_can_put_index - PROCESS_UNTIL_CAN_PUT_ARCHIVE > ca_remote_can_put_archive - PROCESS_UNTIL_HAVE_REQUEST > ca_remote_has_pending_requests But here, the function returns the opposite of what we want: - PROCESS_UNTIL_WRITTEN > ca_remote_has_unwritten Note that I didn't observe any bug due to that, and the test suite succeeds before and after this patch. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed01920 - Browse repository at this point
Copy the full SHA ed01920View commit details -
casync-http: Dont forget to call PROCESS_UNTIL_WRITTEN
While working on this code, I stumbled on cases where casync got stuck because we forgot to call PROCESS_UNTIL_WRITTEN here. Well, TBH as long as we download chunks, we're fine because we end up calling PROCESS_UNTIL_WRITTEN afterwards. But in any case, it seems more correct to sync after downloading these files, and it doesn't hurt. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b88e115 - Browse repository at this point
Copy the full SHA b88e115View commit details -
casync-http: Factorize curl handle work
The way we use curl handle is that we create it once, and then re-use it again and again, as it's more efficient than re-allocating a new one for each request. By looking at the code closely, it turns out that the setup of the curl handle needs to be done only once, then afterwards we only need to change the URL in order to re-use the handle. So this commit brings two helper functions to reflect that: - make_curl_easy_handle() does the init work and set all the options for the handle. - configure_curl_easy_handle() does the things that are needed in order to re-use the handle. In effect, it only sets the URL. Additionally, this commit introduces curl_easy_cleanupp, in order to use automatic pointers. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 669ab87 - Browse repository at this point
Copy the full SHA 669ab87View commit details -
casync-http: Introduce macros to set curl options
These macros aim to make setting curl options easier. CURL_SETOPT_EASY() sets the option, and on failure it outputs a generic error message with the name of the option that failed, and returns -EIO. The CURL_SETOPT_EASY_CANFAIL() variant does not return, it only outputs an error message. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for db25594 - Browse repository at this point
Copy the full SHA db25594View commit details -
casync-http: Use an automatic pointer for the chunks curl handle
This removes the need for the 'finish' label, hence a bunch of goto go away. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1a29cdc - Browse repository at this point
Copy the full SHA 1a29cdcView commit details -
casync-http: Log curl error code in acquire_file()
Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6057748 - Browse repository at this point
Copy the full SHA 6057748View commit details -
casync-http: Use log_error_errno to report casync error code
Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 77652a8 - Browse repository at this point
Copy the full SHA 77652a8View commit details -
casync-http: Move chunks download in a separate function for clarity
The goal is to make the run() function more readable, and only outline the major steps, while the bulk of the work is left to other functions. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e6bfd49 - Browse repository at this point
Copy the full SHA e6bfd49View commit details -
casync-http: use a constant for long option --rate-limit-bps
This long option does not use a short option (see the optstring in call of getopt_long). Use a constant instead, as it is done in casync-tool.c.
Configuration menu - View commit details
-
Copy full SHA for 7b5ab17 - Browse repository at this point
Copy the full SHA 7b5ab17View commit details -
casync-http: Add cmdline option to trust ssl peers
This can be useful for testing, if ever we do HTTP2/SSL with a local, untrusted server. Signed-off-by: Arnaud Rebillout <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bc85e26 - Browse repository at this point
Copy the full SHA bc85e26View commit details