aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-11-02 20:17:25 +0100
committerMartin Storsjö <martin@martin.st>2011-11-06 11:52:57 +0200
commitbb3244dee26e3c500b14830e9500cb2d3658f809 (patch)
tree197235a2c136636ffbeab1464e51a87963ea6e36 /libavformat/http.c
parentba04ecfdacec4cf86e74b43fe8bcc09e06bb7a72 (diff)
downloadffmpeg-bb3244dee26e3c500b14830e9500cb2d3658f809.tar.gz
Replace all usage of strcasecmp/strncasecmp
All current usages of it are incompatible with localization. For example strcasecmp("i", "I") != 0 is possible, but would break many of the places where it is used. Instead use our own implementations that always treat the data as ASCII. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 243a4d78e3..52e1886bef 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -22,7 +22,6 @@
#include "libavutil/avstring.h"
#include "avformat.h"
#include <unistd.h>
-#include <strings.h>
#include "internal.h"
#include "network.h"
#include "http.h"
@@ -251,12 +250,12 @@ static int process_line(URLContext *h, char *line, int line_count,
p++;
while (isspace(*p))
p++;
- if (!strcasecmp(tag, "Location")) {
+ if (!av_strcasecmp(tag, "Location")) {
strcpy(s->location, p);
*new_location = 1;
- } else if (!strcasecmp (tag, "Content-Length") && s->filesize == -1) {
+ } else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) {
s->filesize = atoll(p);
- } else if (!strcasecmp (tag, "Content-Range")) {
+ } else if (!av_strcasecmp (tag, "Content-Range")) {
/* "bytes $from-$to/$document_size" */
const char *slash;
if (!strncmp (p, "bytes ", 6)) {
@@ -266,16 +265,16 @@ static int process_line(URLContext *h, char *line, int line_count,
s->filesize = atoll(slash+1);
}
h->is_streamed = 0; /* we _can_ in fact seek */
- } else if (!strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) {
+ } else if (!av_strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) {
h->is_streamed = 0;
- } else if (!strcasecmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) {
+ } else if (!av_strcasecmp (tag, "Transfer-Encoding") && !av_strncasecmp(p, "chunked", 7)) {
s->filesize = -1;
s->chunksize = 0;
- } else if (!strcasecmp (tag, "WWW-Authenticate")) {
+ } else if (!av_strcasecmp (tag, "WWW-Authenticate")) {
ff_http_auth_handle_header(&s->auth_state, tag, p);
- } else if (!strcasecmp (tag, "Authentication-Info")) {
+ } else if (!av_strcasecmp (tag, "Authentication-Info")) {
ff_http_auth_handle_header(&s->auth_state, tag, p);
- } else if (!strcasecmp (tag, "Connection")) {
+ } else if (!av_strcasecmp (tag, "Connection")) {
if (!strcmp(p, "close"))
s->willclose = 1;
}