mirror of
https://github.com/flatpak/flatpak.git
synced 2025-12-30 11:27:58 -05:00
A few years ago there was a very painful attempt at porting from libsoup2 to libsoup3. Flatpak libsoup3 support never landed and it seems like a large amount of distros have switched over to libcurl instead. This commit removes libsoup2 support completely instead of growing libsoup3 support. Closes #5915 Closes #4582
46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
#include "libglnx.h"
|
|
#include "common/flatpak-utils-http-private.h"
|
|
#include "common/flatpak-utils-private.h"
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
g_autoptr(FlatpakHttpSession) session = flatpak_create_http_session (PACKAGE_STRING);
|
|
g_autoptr(GError) error = NULL;
|
|
const char *url, *dest;
|
|
int flags = 0;
|
|
|
|
if (argc == 3)
|
|
{
|
|
url = argv[1];
|
|
dest = argv[2];
|
|
}
|
|
else if (argc == 4 && g_strcmp0 (argv[1], "--compressed") == 0)
|
|
{
|
|
url = argv[2];
|
|
dest = argv[3];
|
|
flags |= FLATPAK_HTTP_FLAGS_STORE_COMPRESSED;
|
|
}
|
|
else
|
|
{
|
|
g_printerr ("Usage httpcache [--compressed] URL DEST\n");
|
|
return 1;
|
|
}
|
|
|
|
|
|
if (!flatpak_cache_http_uri (session,
|
|
url, NULL,
|
|
flags,
|
|
AT_FDCWD, dest,
|
|
NULL, NULL, NULL, &error))
|
|
{
|
|
g_print ("%s\n", error->message);
|
|
return 1;
|
|
}
|
|
else
|
|
{
|
|
g_print ("Server returned status 200: ok\n");
|
|
return 0;
|
|
}
|
|
}
|