// Effective URL
const char* effective_url;
- // Authentication
- unsigned int auth;
-
// Space for cURL error message
char error[CURL_ERROR_SIZE];
return 0;
}
-int pakfire_xfer_auth(struct pakfire_xfer* xfer) {
- // Enable authentication
- xfer->auth = 1;
-
- return 0;
-}
-
/*
This function translates any cURL error codes into xfer codes
*/
}
}
- // Authentication
- if (xfer->auth) {
- // Request SPNEGO
- r = curl_easy_setopt(xfer->handle, CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE);
- if (r) {
- ERROR(xfer->ctx, "Could not enable SPNEGO\n");
- return r;
- }
-
- // Set an empty username
- r = curl_easy_setopt(xfer->handle, CURLOPT_USERPWD, ":");
- if (r) {
- ERROR(xfer->ctx, "Could not set username\n");
- return r;
- }
- }
-
// Setup progress
r = pakfire_xfer_prepare_progress(xfer, progress, flags);
if (r)
// Input
int pakfire_xfer_set_input(struct pakfire_xfer* xfer, FILE* f);
-// Authentication
-int pakfire_xfer_auth(struct pakfire_xfer* xfer);
-
int pakfire_xfer_prepare(struct pakfire_xfer* xfer, struct pakfire_progress* progress, int flags);
pakfire_xfer_error_code_t pakfire_xfer_done(struct pakfire_xfer* xfer, sd_event* loop, int code);