Commit 6b84b6ed authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Change dmap_connection_get_headers so that it no longer takes a bytes


argument and returns a SoupMessageHeaders *. This is to remain compatible
with Rhythmbox.
Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 6b87cb8c
27 February 2010 W. Michael Petullo <mike@flyn.org>
* Change dmap_connection_get_headers so that it no longer takes a
bytes argument and returns a SoupMessageHeaders *. This is to remain
compatible with Rhythmbox.
12 December 2009 W. Michael Petullo <mike@flyn.org>
* Fixed debug statement that caused segfaults of MIPS32 and
......
......@@ -82,9 +82,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
......
AC_INIT(libdmapsharing, 1.9.0.15)
AC_INIT(libdmapsharing, 1.9.0.16)
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
......
......@@ -1572,16 +1572,15 @@ dmap_connection_do_something (DMAPConnection *connection)
return FALSE;
}
char *
SoupMessageHeaders *
dmap_connection_get_headers (DMAPConnection *connection,
const gchar *uri,
gint64 bytes)
const gchar *uri)
{
DMAPConnectionPrivate *priv = connection->priv;
GString *headers;
SoupMessageHeaders *headers = NULL;
char hash[33] = {0};
char *norb_daap_uri = (char *)uri;
char *s;
char *request_id;
priv->request_id++;
......@@ -1594,37 +1593,40 @@ dmap_connection_get_headers (DMAPConnection *connection,
(guchar*)hash,
priv->request_id);
headers = g_string_new ("Accept: */*\r\n"
"Cache-Control: no-cache\r\n"
"User-Agent: " DMAP_USER_AGENT "\r\n"
"Accept-Language: en-us, en;q=5.0\r\n"
"Client-DAAP-Access-Index: 2\r\n"
"Client-DAAP-Version: 3.0\r\n");
g_string_append_printf (headers,
"Client-DAAP-Validation: %s\r\n"
"Client-DAAP-Request-ID: %d\r\n"
"Connection: close\r\n",
hash, priv->request_id);
headers = soup_message_headers_new (SOUP_MESSAGE_HEADERS_REQUEST);
soup_message_headers_append (headers, "Accept", "*/*");
soup_message_headers_append (headers, "Cache-Control", "no-cache");
soup_message_headers_append (headers, "User-Agent", DMAP_USER_AGENT);
soup_message_headers_append (headers, "Accept-Language",
"en-us, en;q=5.0");
soup_message_headers_append (headers, "Client-DAAP-Access-Index",
"2");
soup_message_headers_append (headers, "Client-DAAP-Version", "3.0");
soup_message_headers_append (headers, "Client-DAAP-Validation", hash);
request_id = g_strdup_printf ("%d", priv->request_id);
soup_message_headers_append (headers, "Client-DAAP-Request-ID",
request_id);
g_free (request_id);
soup_message_headers_append (headers, "Connection", "close");
if (priv->password_protected) {
char *user_pass;
char *token;
char *value;
user_pass = g_strdup_printf ("%s:%s", priv->username, priv->password);
token = g_base64_encode ((guchar *)user_pass, strlen (user_pass));
g_string_append_printf (headers, "Authentication: Basic %s\r\n", token);
value = g_strconcat ("Basic ", token, NULL);
soup_message_headers_append (headers, "Authentication", value);
g_free (value);
g_free (token);
g_free (user_pass);
}
if (bytes != 0) {
g_string_append_printf (headers,"Range: bytes=%"G_GINT64_FORMAT"-\r\n", bytes);
}
s = headers->str;
g_string_free (headers, FALSE);
return s;
return headers;
}
GSList *
......
......@@ -154,9 +154,8 @@ void dmap_connection_disconnect (DMAPConnection *conne
DMAPConnectionCallback callback,
gpointer user_data);
char * dmap_connection_get_headers (DMAPConnection *connection,
const char *uri,
gint64 bytes);
SoupMessageHeaders *dmap_connection_get_headers (DMAPConnection *connection,
const char *uri);
GSList * dmap_connection_get_playlists (DMAPConnection *connection);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment