dav/main.c

changeset 230
fdcbde1d7d65
parent 229
df158262f802
child 235
0468df02e18f
equal deleted inserted replaced
229:df158262f802 230:fdcbde1d7d65
1170 } 1170 }
1171 1171
1172 char *url = a->argv[0]; 1172 char *url = a->argv[0];
1173 char *path = NULL; 1173 char *path = NULL;
1174 DavSession *sn = connect_to_repo(url2repo(url, &path), a); 1174 DavSession *sn = connect_to_repo(url2repo(url, &path), a);
1175 ucx_mempool_reg_destr(sn->mp, path, free);
1175 1176
1176 if(set_session_config(sn, a)) { 1177 if(set_session_config(sn, a)) {
1177 return -1; 1178 return -1;
1178 } 1179 }
1179 1180
1223 } 1224 }
1224 1225
1225 char *url = a->argv[0]; 1226 char *url = a->argv[0];
1226 char *path = NULL; 1227 char *path = NULL;
1227 DavSession *sn = connect_to_repo(url2repo(url, &path), a); 1228 DavSession *sn = connect_to_repo(url2repo(url, &path), a);
1228 1229 ucx_mempool_reg_destr(sn->mp, path, free);
1229 if(set_session_config(sn, a)) { 1230 if(set_session_config(sn, a)) {
1230 return -1; 1231 return -1;
1231 } 1232 }
1232 1233
1233 char *locktoken = cmd_getoption(a, "lock"); 1234 char *locktoken = cmd_getoption(a, "lock");
1240 fprintf(stderr, "No lock token specified.\nAbort.\n"); 1241 fprintf(stderr, "No lock token specified.\nAbort.\n");
1241 return -1; 1242 return -1;
1242 } 1243 }
1243 DavLock *lock = dav_create_lock(sn, locktoken, NULL); 1244 DavLock *lock = dav_create_lock(sn, locktoken, NULL);
1244 dav_add_collection_lock(sn, "/", lock); 1245 dav_add_collection_lock(sn, "/", lock);
1246 free(locktoken);
1245 } 1247 }
1246 1248
1247 DavResource *res = dav_resource_new(sn, path); 1249 DavResource *res = dav_resource_new(sn, path);
1248 if(dav_unlock(res)) { 1250 if(dav_unlock(res)) {
1249 print_resource_error(sn, res->path); 1251 print_resource_error(sn, res->path);

mercurial