311 |
312 |
312 Repository *repo = get_repository(r); |
313 Repository *repo = get_repository(r); |
313 if(repo) { |
314 if(repo) { |
314 *path = sstrdup(p).ptr; |
315 *path = sstrdup(p).ptr; |
315 } else { |
316 } else { |
|
317 // TODO: who is responsible for freeing this repository? |
|
318 // how can the callee know, if he has to call free()? |
316 repo = calloc(1, sizeof(Repository)); |
319 repo = calloc(1, sizeof(Repository)); |
317 repo->name = strdup(""); |
320 repo->name = strdup(""); |
318 repo->decrypt_content = true; |
321 repo->decrypt_content = true; |
319 repo->verification = true; |
322 repo->verification = true; |
320 repo->authmethods = CURLAUTH_BASIC; |
323 repo->authmethods = CURLAUTH_BASIC; |
1653 return -1; |
1656 return -1; |
1654 } |
1657 } |
1655 |
1658 |
1656 char *url = a->argv[0]; |
1659 char *url = a->argv[0]; |
1657 char *path = NULL; |
1660 char *path = NULL; |
1658 Repository *repo = url2repo(url, &path); |
|
1659 DavSession *sn = connect_to_repo(url2repo(url, &path), a); |
1661 DavSession *sn = connect_to_repo(url2repo(url, &path), a); |
1660 ucx_mempool_reg_destr(sn->mp, path, free); |
1662 ucx_mempool_reg_destr(sn->mp, path, free); |
1661 if(set_session_config(sn, a)) { |
1663 if(set_session_config(sn, a)) { |
1662 return -1; |
1664 return -1; |
1663 } |
1665 } |