[xiph-commits] r19053 - in icecast/trunk/icecast: . src
ph3-der-loewe at svn.xiph.org
ph3-der-loewe at svn.xiph.org
Sun Jan 12 04:29:27 PST 2014
Author: ph3-der-loewe
Date: 2014-01-12 04:29:27 -0800 (Sun, 12 Jan 2014)
New Revision: 19053
Modified:
icecast/trunk/icecast/configure.in
icecast/trunk/icecast/src/client.c
icecast/trunk/icecast/src/client.h
icecast/trunk/icecast/src/connection.c
Log:
send 100-continue-header if client requests it
Modified: icecast/trunk/icecast/configure.in
===================================================================
--- icecast/trunk/icecast/configure.in 2014-01-12 12:09:59 UTC (rev 19052)
+++ icecast/trunk/icecast/configure.in 2014-01-12 12:29:27 UTC (rev 19053)
@@ -38,6 +38,7 @@
AC_CHECK_FUNCS([setuid])
AC_CHECK_FUNCS([chroot])
AC_CHECK_FUNCS([chown])
+AC_CHECK_FUNCS([strcasestr])
dnl Checks for typedefs, structures, and compiler characteristics.
XIPH_C__FUNC__
Modified: icecast/trunk/icecast/src/client.c
===================================================================
--- icecast/trunk/icecast/src/client.c 2014-01-12 12:09:59 UTC (rev 19052)
+++ icecast/trunk/icecast/src/client.c 2014-01-12 12:29:27 UTC (rev 19053)
@@ -202,6 +202,12 @@
fserve_add_client (client, NULL);
}
+void client_send_100(client_t *client)
+{
+ /* On demand inject a HTTP/1.1 100 Continue to make sure clients are happy */
+ sock_write (client->con->sock, "HTTP/1.1 100 Continue\r\n\r\n");
+}
+
void client_send_400(client_t *client, const char *message)
{
client_send_error(client, 400, 0, message);
Modified: icecast/trunk/icecast/src/client.h
===================================================================
--- icecast/trunk/icecast/src/client.h 2014-01-12 12:09:59 UTC (rev 19052)
+++ icecast/trunk/icecast/src/client.h 2014-01-12 12:29:27 UTC (rev 19053)
@@ -70,6 +70,7 @@
int client_create (client_t **c_ptr, connection_t *con, http_parser_t *parser);
void client_destroy(client_t *client);
+void client_send_100(client_t *client);
void client_send_404(client_t *client, const char *message);
void client_send_401(client_t *client);
void client_send_403(client_t *client, const char *message);
Modified: icecast/trunk/icecast/src/connection.c
===================================================================
--- icecast/trunk/icecast/src/connection.c 2014-01-12 12:09:59 UTC (rev 19052)
+++ icecast/trunk/icecast/src/connection.c 2014-01-12 12:29:27 UTC (rev 19053)
@@ -804,6 +804,7 @@
if (global.sources < config->source_limit)
{
const char *contenttype;
+ const char *expectcontinue;
mount_proxy *mountinfo;
format_type_t format_type;
@@ -846,6 +847,21 @@
return -1;
}
+ /* For PUT support we check for 100-continue and send back a 100 to stay in spec */
+ expectcontinue = httpp_getvar (source->parser, "expect");
+ if (expectcontinue != NULL)
+ {
+#ifdef HAVE_STRCASESTR
+ if (strcasestr (expectcontinue, "100-continue") != NULL)
+#else
+ WARN0("OS doesn't support case insenestive substring checks...");
+ if (strstr (expectcontinue, "100-continue") != NULL)
+#endif
+ {
+ client_send_100 (source->client);
+ }
+ }
+
global.sources++;
stats_event_args (NULL, "sources", "%d", global.sources);
global_unlock();
More information about the commits
mailing list