Browse Source

Move the definition of the maximum url size for static buffers to internal.h

Originally committed as revision 24833 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Martin Storsjö 15 years ago
parent
commit
e55ebcc3f6
2 changed files with 4 additions and 3 deletions
  1. +2
    -3
      libavformat/http.c
  2. +2
    -0
      libavformat/internal.h

+ 2
- 3
libavformat/http.c View File

@@ -35,7 +35,6 @@


/* used for protocol handling */ /* used for protocol handling */
#define BUFFER_SIZE 1024 #define BUFFER_SIZE 1024
#define URL_SIZE 4096
#define MAX_REDIRECTS 8 #define MAX_REDIRECTS 8


typedef struct { typedef struct {
@@ -46,7 +45,7 @@ typedef struct {
int http_code; int http_code;
int64_t chunksize; /**< Used if "Transfer-Encoding: chunked" otherwise -1. */ int64_t chunksize; /**< Used if "Transfer-Encoding: chunked" otherwise -1. */
int64_t off, filesize; int64_t off, filesize;
char location[URL_SIZE];
char location[MAX_URL_SIZE];
HTTPAuthState auth_state; HTTPAuthState auth_state;
unsigned char headers[BUFFER_SIZE]; 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. */ int willclose; /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */
@@ -162,7 +161,7 @@ static int http_open(URLContext *h, const char *uri, int flags)
h->is_streamed = 1; h->is_streamed = 1;


s->filesize = -1; s->filesize = -1;
av_strlcpy(s->location, uri, URL_SIZE);
av_strlcpy(s->location, uri, sizeof(s->location));


return http_open_cnx(h); return http_open_cnx(h);
} }


+ 2
- 0
libavformat/internal.h View File

@@ -24,6 +24,8 @@
#include <stdint.h> #include <stdint.h>
#include "avformat.h" #include "avformat.h"


#define MAX_URL_SIZE 4096

typedef struct AVCodecTag { typedef struct AVCodecTag {
enum CodecID id; enum CodecID id;
unsigned int tag; unsigned int tag;


Loading…
Cancel
Save