aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http_auth.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-06-30 02:43:13 +0000
committerEric Wong <normalperson@yhbt.net>2008-06-30 02:43:13 +0000
commit2a5dcba5edaaf241ea85ec6cad7ccd9665774ee4 (patch)
tree9ccb6008bf7d841342404019d163851ac9d001b8 /src/inputStream_http_auth.h
parentc71cfbac7a461734fad2982867701bba8874f359 (diff)
downloadmpd-2a5dcba5edaaf241ea85ec6cad7ccd9665774ee4.tar.gz
mpd-2a5dcba5edaaf241ea85ec6cad7ccd9665774ee4.tar.xz
mpd-2a5dcba5edaaf241ea85ec6cad7ccd9665774ee4.zip
http: initial rewrite using ringbuffer + pthreads
This institutes the usage of a separate thread to buffer HTTP input. It is basically practice code for using the ringbuffer code which I plan on reusing for the OutputBuffer as well as further input buffering for disk (networked filesystems over WAN, laptops on battery, etc). Each readFromInputStream() call on an HTTP stream can take several seconds to complete, short reads are avoided. A single-threaded solution for systems supporting large enough SO_RCVBUF values should also be possible and will likely be done in the future; but this lock-free(except when full/empty) ringbuffer is cool :) git-svn-id: https://svn.musicpd.org/mpd/trunk@7393 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputStream_http_auth.h')
-rw-r--r--src/inputStream_http_auth.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/inputStream_http_auth.h b/src/inputStream_http_auth.h
index db4fb4584..2caf3a09d 100644
--- a/src/inputStream_http_auth.h
+++ b/src/inputStream_http_auth.h
@@ -27,7 +27,7 @@
#define BASE64_LENGTH(len) (4 * (((len) + 2) / 3))
-static char *base64Dup(char *s)
+static char *base64dup(char *s)
{
int i;
int len = strlen(s);
@@ -64,8 +64,8 @@ static char *base64Dup(char *s)
return ret;
}
-static char *authString(const char *header,
- const char *user, const char *password)
+static char *auth_string(const char *header,
+ const char *user, const char *password)
{
char *ret = NULL;
int templen;
@@ -80,7 +80,7 @@ static char *authString(const char *header,
strcpy(temp, user);
strcat(temp, ":");
strcat(temp, password);
- temp64 = base64Dup(temp);
+ temp64 = base64dup(temp);
free(temp);
ret = xmalloc(strlen(temp64) + strlen(header) + 3);
@@ -95,7 +95,7 @@ static char *authString(const char *header,
#define PROXY_AUTH_HEADER "Proxy-Authorization: Basic "
#define HTTP_AUTH_HEADER "Authorization: Basic "
-#define proxyAuthString(x, y) authString(PROXY_AUTH_HEADER, x, y)
-#define httpAuthString(x, y) authString(HTTP_AUTH_HEADER, x, y)
+#define proxy_auth_string(x, y) auth_string(PROXY_AUTH_HEADER, x, y)
+#define http_auth_string(x, y) auth_string(HTTP_AUTH_HEADER, x, y)
#endif /* INPUT_STREAM_HTTP_AUTH_H */