changeset 6390:27242bd0812c libavformat

Move the definition of the maximum url size for static buffers to internal.h
author mstorsjo
date Thu, 19 Aug 2010 14:50:40 +0000
parents 054de75e4a49
children d05e8fb04c6f
files http.c internal.h
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/http.c	Thu Aug 19 14:49:53 2010 +0000
+++ b/http.c	Thu Aug 19 14:50:40 2010 +0000
@@ -35,7 +35,6 @@
 
 /* used for protocol handling */
 #define BUFFER_SIZE 1024
-#define URL_SIZE    4096
 #define MAX_REDIRECTS 8
 
 typedef struct {
@@ -46,7 +45,7 @@
     int http_code;
     int64_t chunksize;      /**< Used if "Transfer-Encoding: chunked" otherwise -1. */
     int64_t off, filesize;
-    char location[URL_SIZE];
+    char location[MAX_URL_SIZE];
     HTTPAuthState auth_state;
     unsigned char headers[BUFFER_SIZE];
     int willclose;          /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */
@@ -162,7 +161,7 @@
     h->is_streamed = 1;
 
     s->filesize = -1;
-    av_strlcpy(s->location, uri, URL_SIZE);
+    av_strlcpy(s->location, uri, sizeof(s->location));
 
     return http_open_cnx(h);
 }
--- a/internal.h	Thu Aug 19 14:49:53 2010 +0000
+++ b/internal.h	Thu Aug 19 14:50:40 2010 +0000
@@ -24,6 +24,8 @@
 #include <stdint.h>
 #include "avformat.h"
 
+#define MAX_URL_SIZE 4096
+
 typedef struct AVCodecTag {
     enum CodecID id;
     unsigned int tag;