aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19inputStream_http: cleanup GET request code (finishHTTPInit)Eric Wong1-29/+29
Avoid unnecessary memset to zero, snprintf always puts a trailing '\0'. We also have no need to subtract one from the buffer we're snprintf-ing it to. We also check the return value of snprintf to ensure it's not too long. I have a feeling we might as well avoid snprintf altogether so we don't have to worry about buffer sizing/stack overflow and just do a bunch of write(2)s, letting Nagle sort it out... Also, centralize some of the exit error handling in with goto. This makes the code a bit more consistent and maintainable as well as reducing code and binary size. git-svn-id: https://svn.musicpd.org/mpd/trunk@5395 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19inputStream_http: fix HTTP seekingEric Wong1-1/+1
We need to identify ourselves as HTTP/1.1 so Range: works; and so the server can return HTTP/1.1 instead of HTTP/1.0. Tested against lighttpd 1.4.13 git-svn-id: https://svn.musicpd.org/mpd/trunk@5394 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-06Fix a bug where mpd would complain about a proxy password being specifiedJ. Alexander Treuman1-7/+7
and not a proxy user even when both are specified. git-svn-id: https://svn.musicpd.org/mpd/trunk@5324 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong1-4/+4
Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14inputStream_http: stop mixing declarations with codeEric Wong1-1/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@5242 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-12-23Adding support for seeking HTTP streams.J. Alexander Treuman1-17/+24
git-svn-id: https://svn.musicpd.org/mpd/trunk@5159 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-20/+20
I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30remove clumsy strncpy useEric Wong1-5/+5
strncpy isn't really safe because it doesn't guarantee null termination, and we have had to work around it in several places. strlcpy (from OpenBSD) isn't great, either because it often leaves errors going unchecked (by truncating strings). So we'll add the pathcpy_trunc() function with is basically strlcpy with a hardcoded MAXPATHLEN as the limit, and we'll acknowledge truncation since we only work on paths and MAXPATHLEN should be set correctly by the system headers[1]. file-specific notes: inputStream_http: eyeballing the changes here, it seems to look alright but I haven't actually tested it myself. ls: don't even bother printing a file if the filename is too long (and when is it ever?) since we won't be able to read it anyways. metadataChunk: it's only metadata, and it's only for showin the user, so truncating it here souldn't be a big issue. memset to zero in init is unecessary, so lets not waste cycles [1] - If the system headers are screwed up, then we're majorly screwed regardless of what we do :x git-svn-id: https://svn.musicpd.org/mpd/trunk@4491 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-3/+3
Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-559/+589
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-17sparse: ANSI-fy function declarationsEric Wong1-2/+2
These are just warnings from sparse, but it makes the output easier to read. I ran this through a quick perl script, but of course verified the output by looking at the diff and making sure the thing still compiles. here's the quick perl script I wrote to generate this patch: ----------- 8< ----------- use Tie::File; defined(my $pid = open my $fh, '-|') or die $!; if (!$pid) { open STDERR, '>&STDOUT' or die $!; exec 'sparse', @ARGV or die $!; } my $na = 'warning: non-ANSI function declaration of function'; while (<$fh>) { print STDERR $_; if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) { my ($f, $l, $pos, $func) = ($1, $2, $3, $4); $l--; tie my @x, 'Tie::File', $f or die "$!: $f"; print '-', $x[$l], "\n"; $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/; print '+', $x[$l], "\n"; untie @x; } } git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-05-21inputStream_http: avoid printf, use our handy macros in log.hEric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4210 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-05-14Applied a modified patch for bug 344, needs testing with ipv6Qball Cow1-83/+69
git-svn-id: https://svn.musicpd.org/mpd/trunk@4171 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-16merge with mpd/trunk up to r3925Eric Wong1-0/+14
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-15inputStream_http.c: speling fikcsesEric Wong1-4/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@3921 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-04-17fix some parsing of http_prebuffer_sizeWarren Dukes1-3/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@3216 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-01-23change the http identification string to package_name/package_versionWarren Dukes1-1/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@2896 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-20fix oss_openDevice() to match the new openDevice callback protocol (w/o a ↵Warren Dukes1-1/+2
audioFormat argument) git-svn-id: https://svn.musicpd.org/mpd/trunk@2715 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-05not too smart shank, forgetting to set default buffer sizes in inputStream_httpWarren Dukes1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@2513 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-02make http buffer and prebuffer size configurableWarren Dukes1-10/+51
git-svn-id: https://svn.musicpd.org/mpd/trunk@2479 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-28merge shank-rewrite-config changesWarren Dukes1-48/+60
git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-26fix segfault when reconnecting to icecast server, this was due to error ↵Warren Dukes1-1/+0
sending metadata and not checking afterward if connection is open still git-svn-id: https://svn.musicpd.org/mpd/trunk@2349 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-25stream name maybe icy-name or ice-name in the http headersWarren Dukes1-1/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@2339 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-18fix bug #325Warren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@2270 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-18fix a bug in username and password parsing in http url'sWarren Dukes1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@1877 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-17added http authentication: http://user:passwd@host/musicWarren Dukes1-7/+54
git-svn-id: https://svn.musicpd.org/mpd/trunk@1872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-21don't use fucking sprintfWarren Dukes1-3/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@1596 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-21maybe this matters ?Warren Dukes1-1/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@1595 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-21maybe this fixes something ?Warren Dukes1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@1594 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-20http proxy authentication, can someone test?Warren Dukes1-11/+79
git-svn-id: https://svn.musicpd.org/mpd/trunk@1590 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-20http proxy mostly working, need to implement http authenticationWarren Dukes1-9/+42
git-svn-id: https://svn.musicpd.org/mpd/trunk@1588 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-20fix qball's bug, crossfading playing with funny samplerateWarren Dukes1-0/+50
git-svn-id: https://svn.musicpd.org/mpd/trunk@1585 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-17include sys/time.hWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1522 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-09fix bug where inputStream_httpRead was returning 0 when cnnection closed,Warren Dukes1-3/+4
but data is still left in the buffer git-svn-id: https://svn.musicpd.org/mpd/trunk@1425 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-09debug code for stream name/titleWarren Dukes1-0/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@1415 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-07remove metadata debugging codeWarren Dukes1-2/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-07remove the initial and trailing ' from the icy StreamTitle that shoutcastWarren Dukes1-2/+7
likes to insert git-svn-id: https://svn.musicpd.org/mpd/trunk@1366 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-07icy metadata! wahooWarren Dukes1-17/+63
still lots some debug code with print out's, so don't bitch about it! git-svn-id: https://svn.musicpd.org/mpd/trunk@1364 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-01remove some debug codeWarren Dukes1-3/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1282 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-01icyName fixWarren Dukes1-4/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@1271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31icynames are now copied to title of streamsWarren Dukes1-9/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31mp3 and ogg plugin stuffWarren Dukes1-1/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@1245 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-24put icyName debug infoWarren Dukes1-0/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@1151 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-21do input buffering in while sleeping loop of sending stuff to output bufferWarren Dukes1-7/+7
git-svn-id: https://svn.musicpd.org/mpd/trunk@1125 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-20more bug fixesWarren Dukes1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@1108 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-20ogg stream playing! some non-blocking seek bug fixesWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1105 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-19todo updateWarren Dukes1-0/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@1094 09075e82-0dd4-0310-85a5-a0d7c8717e4f