aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2011-02-21 18:52:16 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2011-02-21 18:52:16 +0000
commit30c72f95796b2936bec99fe4a96d1f6e1c367f11 (patch)
treeb5f26ce7c5ca4bd5d3d8a39c0383a510e49ed199 /net
parent5169fa7f15cfc8df742cdfa6572f2288e8111de4 (diff)
Accepts HTTP 1.0 as well as 1.1. Increased buffer for status lines to 4096.
svn path=/trunk/externals/mrpeach/; revision=14937
Diffstat (limited to 'net')
-rw-r--r--net/httpreceive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/httpreceive.c b/net/httpreceive.c
index 6c9e5a2..6b8d171 100644
--- a/net/httpreceive.c
+++ b/net/httpreceive.c
@@ -8,7 +8,7 @@
static t_class *httpreceive_class;
-#define STATUS_BUF_LEN 1024
+#define STATUS_BUF_LEN 4096 /* how big can the status part get? */
typedef struct _httpreceive
{
@@ -84,7 +84,7 @@ static void httpreceive_list(t_httpreceive *x, t_symbol *s, int argc, t_atom *ar
x->x_status_buf[x->x_status_buf_write_index+1] = 0;
if (x->x_verbosity) post("httpreceive_list: status: %s", x->x_status_buf);
/* get status code from first line */
- if (1 != sscanf(x->x_status_buf, "HTTP/1.1 %d", &j))
+ if ((1 != sscanf(x->x_status_buf, "HTTP/1.1 %d", &j)) && (1 != sscanf(x->x_status_buf, "HTTP/1.0 %d", &j)))
{
pd_error(x, "httpreceive_list: malformed status line");
post("httpreceive_list: status: %s", x->x_status_buf);
@@ -147,7 +147,7 @@ static void httpreceive_list(t_httpreceive *x, t_symbol *s, int argc, t_atom *ar
}
} // if end of status response
else x->x_status_buf_write_index++;
- if (x->x_status_buf_write_index >= STATUS_BUF_LEN)
+ if (x->x_status_buf_write_index >= x->x_status_buf_len)
{
pd_error(x, "httpreceive_list: status buffer full");
x->x_status_buf_write_index = 0;