Commit e4de5bf4 authored by Gleb Pinigin's avatar Gleb Pinigin
Browse files

CocoaHTTPServer: fix bonjour announcements (fixes #8741)

parent 6cc8e77b
From dde84f7d01777cbf82e9f7bcb15960f206ec5a33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Fri, 31 May 2013 10:54:44 +0200
Subject: [PATCH] Disable Bonjour announcements since those are too unstable
---
Core/HTTPServer.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Core/HTTPServer.m b/Core/HTTPServer.m
index 57384f7..0f227b2 100644
--- a/Core/HTTPServer.m
+++ b/Core/HTTPServer.m
@@ -416,7 +416,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_INFO; // | HTTP_LOG_FLAG_TRACE;
HTTPLogInfo(@"%@: Started HTTP server on port %hu", THIS_FILE, [asyncSocket localPort]);
isRunning = YES;
- [self publishBonjour];
+// [self publishBonjour];
}
else
{
@@ -442,7 +442,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_INFO; // | HTTP_LOG_FLAG_TRACE;
dispatch_sync(serverQueue, ^{ @autoreleasepool {
// First stop publishing the service via bonjour
- [self unpublishBonjour];
+ //[self unpublishBonjour];
// Stop listening / accepting incoming connections
[asyncSocket disconnect];
--
1.7.12.4 (Apple Git-37)
From 6b4f5a3ed99d3206e0e8872db9d981abf951a133 Mon Sep 17 00:00:00 2001
From ed78f177bf9772643f44cea1a7a1b6ba4ed77d46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Sat, 15 Jun 2013 21:59:12 +0200
Subject: [PATCH 2/3] MultipartFormDataParser: fix future compilation warning
Subject: [PATCH 1/4] MultipartFormDataParser: fix future compilation warning
---
Core/Mime/MultipartFormDataParser.m | 2 +-
......@@ -21,5 +21,5 @@ index 4a19aee..0676ba4 100644
// we don't break the format.
int sizeToLeavePending = 0;
--
1.8.2.1 (Apple Git-45)
1.7.12.4 (Apple Git-37)
From 8f5414f8e2445915d70a5c13f04d93007313d35b Mon Sep 17 00:00:00 2001
From 945cd4165cb841fa120324fa633dc4e1f3ee4634 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Sat, 15 Jun 2013 22:03:24 +0200
Subject: [PATCH 3/3] Respond with correct Content-Type for html, js, css, png
Subject: [PATCH 2/4] Respond with correct Content-Type for html, js, css, png
and jpg
---
......@@ -51,5 +51,5 @@ index f303cf3..8b4963d 100644
--
1.8.2.1 (Apple Git-45)
1.7.12.4 (Apple Git-37)
From 72b746f89eced49a5e17b53a6e792f3a987efabf Mon Sep 17 00:00:00 2001
From d7cd8b0cb90ef0f5af3807b2eb5a042521560874 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Sun, 16 Jun 2013 23:35:17 +0200
Subject: [PATCH 4/4] fix crash when uploading multiple files
Subject: [PATCH 3/4] fix crash when uploading multiple files
---
Core/HTTPConnection.m | 28 ++++++++++++++--------------
......@@ -47,5 +47,5 @@ index 2742415..95e283a 100644
// Write the header response
--
1.8.2.1 (Apple Git-45)
1.7.12.4 (Apple Git-37)
From 2e71373c6d8f390376c679dfe4676c5068612b60 Mon Sep 17 00:00:00 2001
From: Gleb Pinigin <gpinigin@gmail.com>
Date: Thu, 1 Aug 2013 19:22:27 +0700
Subject: [PATCH 4/4] bonjour: nullify delegate before removing service from
current runloop
---
Core/HTTPServer.m | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Core/HTTPServer.m b/Core/HTTPServer.m
index 57384f7..5983121 100644
--- a/Core/HTTPServer.m
+++ b/Core/HTTPServer.m
@@ -568,7 +568,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_INFO; // | HTTP_LOG_FLAG_TRACE;
if (type)
{
netService = [[NSNetService alloc] initWithDomain:domain type:type name:name port:[asyncSocket localPort]];
- [netService setDelegate:self];
+ netService.delegate = self;
NSNetService *theNetService = netService;
NSData *txtRecordData = nil;
@@ -576,8 +576,6 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_INFO; // | HTTP_LOG_FLAG_TRACE;
txtRecordData = [NSNetService dataFromTXTRecordDictionary:txtRecordDictionary];
dispatch_block_t bonjourBlock = ^{
-
- [theNetService removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[theNetService scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
[theNetService publish];
@@ -603,10 +601,11 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_INFO; // | HTTP_LOG_FLAG_TRACE;
if (netService)
{
NSNetService *theNetService = netService;
+ netService.delegate = nil;
dispatch_block_t bonjourBlock = ^{
-
[theNetService stop];
+ [theNetService removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
};
[[self class] performBonjourBlock:bonjourBlock];
--
1.7.12.4 (Apple Git-37)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment