summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-01-11 12:46:29 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2006-01-11 12:46:29 +0000
commit4297d390d8b4680d8a22df9d88f0298301832cfc (patch)
tree662eba40d828d556f29ce3be3d32e312018a999e
parent1de2544134324afc4b1fda471e119f0fdaf9e4d7 (diff)
downloadneon-4297d390d8b4680d8a22df9d88f0298301832cfc.tar.gz
* src/ne_request.c (read_status_line): Handle ICY protocol responses
for the time being. git-svn-id: http://svn.webdav.org/repos/projects/neon/branches/0.25.x@843 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
-rw-r--r--src/ne_request.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ne_request.c b/src/ne_request.c
index 1a3d130..fd8f09d 100644
--- a/src/ne_request.c
+++ b/src/ne_request.c
@@ -1,6 +1,6 @@
/*
HTTP request/response handling
- Copyright (C) 1999-2005, Joe Orton <joe@manyfish.co.uk>
+ Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -971,8 +971,20 @@ static int read_status_line(ne_request *req, ne_status *status, int retry)
if (status->reason_phrase) ne_free(status->reason_phrase);
memset(status, 0, sizeof *status);
- if (ne_parse_statusline(buffer, status))
+ if (strncmp(buffer, "ICY ", 4) == 0 && strlen(buffer) > 8
+ && buffer[7] == ' ') {
+ /* Hack for ShoutCast support; will be conditional in future
+ * releases. */
+ status->code = atoi(buffer + 4);
+ status->major_version = 1;
+ status->minor_version = 0;
+ status->reason_phrase = ne_strclean(ne_strdup(buffer + 8));
+ status->klass = buffer[4] - '0';
+ NE_DEBUG(NE_DBG_HTTP, "[status-line] ICY protocol; code %d\n",
+ status->code);
+ } else if (ne_parse_statusline(buffer, status)) {
return aborted(req, _("Could not parse response status line."), 0);
+ }
return 0;
}