[FFmpeg-cvslog] r23685 - in trunk/libavformat: http.c http.h

mstorsjo subversion
Mon Jun 21 21:40:30 CEST 2010


Author: mstorsjo
Date: Mon Jun 21 21:40:30 2010
New Revision: 23685

Log:
HTTP: Add a method for initializing the authentication state from another connection

Modified:
   trunk/libavformat/http.c
   trunk/libavformat/http.h

Modified: trunk/libavformat/http.c
==============================================================================
--- trunk/libavformat/http.c	Mon Jun 21 21:02:35 2010	(r23684)
+++ trunk/libavformat/http.c	Mon Jun 21 21:40:30 2010	(r23685)
@@ -69,6 +69,12 @@ void ff_http_set_chunked_transfer_encodi
     ((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)
 {

Modified: trunk/libavformat/http.h
==============================================================================
--- trunk/libavformat/http.h	Mon Jun 21 21:02:35 2010	(r23684)
+++ trunk/libavformat/http.h	Mon Jun 21 21:40:30 2010	(r23685)
@@ -50,4 +50,15 @@ void ff_http_set_headers(URLContext *h, 
  */
 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 */



More information about the ffmpeg-cvslog mailing list