]> git.sesse.net Git - cubemap/blobdiff - httpinput.cpp
Fix handling of streams with no data.
[cubemap] / httpinput.cpp
index c9231453e1e919062024073d1d73efa1dc1fd487..68b91708e7b3059eeac08d3d62088daae2d90aa4 100644 (file)
@@ -8,6 +8,7 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <time.h>
 #include <unistd.h>
 #include <map>
@@ -22,6 +23,7 @@
 #include "parse.h"
 #include "serverpool.h"
 #include "state.pb.h"
+#include "stream.h"
 #include "util.h"
 #include "version.h"
 
@@ -77,13 +79,6 @@ HTTPInput::HTTPInput(const InputProto &serialized)
        string protocol;
        parse_url(url, &protocol, &host, &port, &path);  // Don't care if it fails.
 
-       // Older versions stored the extra \r\n in the HTTP header.
-       // Strip it if we find it.
-       if (http_header.size() >= 4 &&
-           memcmp(http_header.data() + http_header.size() - 4, "\r\n\r\n", 4) == 0) {
-               http_header.resize(http_header.size() - 2);
-       }
-
        pthread_mutex_init(&stats_mutex, NULL);
        stats.url = url;
        stats.bytes_received = serialized.bytes_received();