git://git.jankratochvil.net
/
middleman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b69b998
)
Substitute missing strcasestr(3)
author
short
<>
Mon, 18 Nov 2002 14:21:44 +0000
(14:21 +0000)
committer
short
<>
Mon, 18 Nov 2002 14:21:44 +0000
(14:21 +0000)
src/protocol.c
patch
|
blob
|
history
diff --git
a/src/protocol.c
b/src/protocol.c
index
9f186ce
..
e89938a
100644
(file)
--- a/
src/protocol.c
+++ b/
src/protocol.c
@@
-23,6
+23,7
@@
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <ctype.h>
#include "../libntlm/ntlm.h"
#include "proto.h"
#include "../libntlm/ntlm.h"
#include "proto.h"
@@
-395,11
+396,17
@@
int protocol_http(CONNECTION * connection)
FREE_AND_NULL(connection->rheader->content_encoding);
if (connection->header->accept_encoding != NULL) {
/* compress the content if the browser supports gzip encoding */
FREE_AND_NULL(connection->rheader->content_encoding);
if (connection->header->accept_encoding != NULL) {
/* compress the content if the browser supports gzip encoding */
- ptr = strcasestr(connection->header->accept_encoding, "gzip");
+ char *s, *accept_encoding_lower = xstrdup(connection->header->accept_encoding);
+
+ /* strcasestr(3) is not available on some systems; use strstr(3) instead */
+ for (s=accept_encoding_lower; *s; s++)
+ *s=tolower(*s);
+ ptr = strstr(accept_encoding_lower, "gzip");
if (ptr != NULL) {
ret = filebuf_gzip(filebuf);
if (ret == TRUE) connection->rheader->content_encoding = xstrdup("gzip");
}
if (ptr != NULL) {
ret = filebuf_gzip(filebuf);
if (ret == TRUE) connection->rheader->content_encoding = xstrdup("gzip");
}
+ free(accept_encoding_lower);
}
bypass:
}
bypass: