return -1;
}
- headers = g_strdup_printf ("Content-Range: bytes %" G_GINT64_FORMAT "-%" G_GINT64_FORMAT "/*\r\n"
- "Content-Length: %" G_GSIZE_FORMAT "\r\n",
- winhttp_stream->offset, winhttp_stream->offset + count, count);
+ headers = g_strdup_printf ("Content-Range: bytes %" G_GINT64_FORMAT "-%" G_GINT64_FORMAT "/*\r\n",
+ winhttp_stream->offset, winhttp_stream->offset + count);
wheaders = g_utf8_to_utf16 (headers, -1, NULL, NULL, NULL);
g_free (headers);
(request,
wheaders, -1,
NULL, 0,
- 0,
+ count,
0))
{
char *emsg = _g_winhttp_error_message (GetLastError ());
return -1;
}
- winhttp_stream->offset += count;
g_free (wheaders);
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpWriteData
return -1;
}
+ winhttp_stream->offset += bytes_written;
+
if (!G_WINHTTP_VFS_GET_CLASS (winhttp_stream->file->vfs)->pWinHttpReceiveResponse
(request, NULL))
{