[SCM] libav/experimental: HTTP: Add a method for initializing the authentication state from another connection

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:08:55 UTC 2013


The following commit has been merged in the experimental branch:
commit db3023479448d0bbe8e4b659a4f199713ded99f7
Author: Martin Storsjö <martin at martin.st>
Date:   Mon Jun 21 19:40:30 2010 +0000

    HTTP: Add a method for initializing the authentication state from another connection
    
    Originally committed as revision 23685 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/http.c b/libavformat/http.c
index 27d4e8a..4a46b41 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -69,6 +69,12 @@ void ff_http_set_chunked_transfer_encoding(URLContext *h, int is_chunked)
     ((HTTPContext*)h->priv_data)->chunksize = is_chunked ? 0 : -1;
 }
 
+void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
+{
+    memcpy(&((HTTPContext*)dest->priv_data)->auth_state,
+           &((HTTPContext*)src->priv_data)->auth_state, sizeof(HTTPAuthState));
+}
+
 /* return non zero if error */
 static int http_open_cnx(URLContext *h)
 {
diff --git a/libavformat/http.h b/libavformat/http.h
index fe5539a..a0ae943 100644
--- a/libavformat/http.h
+++ b/libavformat/http.h
@@ -50,4 +50,15 @@ void ff_http_set_headers(URLContext *h, const char *headers);
  */
 void ff_http_set_chunked_transfer_encoding(URLContext *h, int is_chunked);
 
+/**
+ * Initialize the authentication state based on another HTTP URLContext.
+ * This can be used to pre-initialize the authentication parameters if
+ * they are known beforehand, to avoid having to do an initial failing
+ * request just to get the parameters.
+ *
+ * @param dest URL context whose authentication state gets updated
+ * @param src URL context whose authentication state gets copied
+ */
+void ff_http_init_auth_state(URLContext *dest, const URLContext *src);
+
 #endif /* AVFORMAT_HTTP_H */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list