summaryrefslogtreecommitdiff
path: root/thread_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_http.c')
-rw-r--r--thread_http.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/thread_http.c b/thread_http.c
index b257131..353ad0f 100644
--- a/thread_http.c
+++ b/thread_http.c
@@ -69,21 +69,23 @@ void thread_http_connection(int fd) {
while (strcmp(line_buf, "\r\n") != 0)
getline(&line_buf, &line_cap, stream);
- if (strcmp(path, "/kinect-video.mpjpg") == 0) {
+ const char *boundary = "boundary";
+ if (strcmp(path, "/kinect-video.mjpg") == 0) {
dprintf(fd,
"HTTP/1.1 200 OK\r\n"
"Content-Type: multipart/x-mixed-replace;boundary=%s\r\n"
"\r\n",
- "--boundary");
- thread_mpjpeg_writer(video, fd, "--boundary");
- } else if (strcmp(path, "/kinect-depth.mpjpg") == 0) {
+ boundary);
+ thread_mpjpeg_writer(video, fd, boundary);
+ } else if (strcmp(path, "/kinect-depth.mjpg") == 0) {
dprintf(fd,
"HTTP/1.1 200 OK\r\n"
"Content-Type: multipart/x-mixed-replace;boundary=%s\r\n"
"\r\n",
- "--boundary");
- thread_mpjpeg_writer(depth, fd, "--boundary");
+ boundary);
+ thread_mpjpeg_writer(depth, fd, boundary);
} else {
+ printf("not found url: %s\n", path);
dprintf(fd,
"HTTP/1.1 404 Not Found\r\n"
"\r\n");
@@ -123,6 +125,5 @@ void thread_http_listener(struct wg *awg,
continue;
start_http_connection(conn);
}
- running = 0;
- close(httpsock);
+ finish(0);
}