fix: TCP network issues

This commit is contained in:
ngn
2024-08-08 02:30:51 +03:00
parent d7dd578fc4
commit 65a9d7610b
14 changed files with 139 additions and 49 deletions

View File

@ -97,11 +97,15 @@ bool lm_pool_info_download(lm_pool_t *pool, lm_mptp_transfer_callback_t callback
lm_mptp_set_host(&packet, pool->url.host);
lm_mptp_set_data(&packet, pool->url.path, strlen(pool->url.path));
if(!lm_mptp_client_send(sock, &packet))
if(!lm_mptp_client_send(sock, &packet)){
pdebug(__func__, "info file request failed for %s: %s", pool->name, lm_strerror());
goto end;
}
if(!lm_mptp_recvfile(sock, pool->info_file, callback, data))
if(!lm_mptp_recvfile(sock, pool->info_file, callback, data)){
pdebug(__func__, "recvfile failed for %s: %s", pool->name, lm_strerror());
goto end;
}
ret = true;
end:

View File

@ -123,11 +123,15 @@ bool lm_pool_list_download(lm_pool_t *pool, char *dir, lm_mptp_transfer_callback
lm_mptp_set_host(&packet, pool->url.host);
lm_mptp_set_data(&packet, pool->url.path, strlen(pool->url.path));
if(!lm_mptp_client_send(sock, &packet))
if(!lm_mptp_client_send(sock, &packet)){
pdebug(__func__, "list file request failed for %s: %s", pool->name, lm_strerror());
goto end;
}
if(!lm_mptp_recvfile(sock, pool->list_file, callback, data))
if(!lm_mptp_recvfile(sock, pool->list_file, callback, data)){
pdebug(__func__, "recvfile failed for %s: %s", pool->name, lm_strerror());
goto end;
}
ret = true;
end: