Skip to content

Commit 80074ed

Browse files
committed
MistProcLivepeer port from Livepeer branch
1 parent bed33dd commit 80074ed

5 files changed

Lines changed: 160 additions & 67 deletions

File tree

lib/downloader.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "ev.h"
66
#include "timing.h"
77

8+
static const std::string emptyString;
9+
810
namespace HTTP{
911

1012
Downloader::Downloader(){
@@ -613,6 +615,11 @@ namespace HTTP{
613615
return false;
614616
}
615617

618+
const std::string & Downloader::getCookie() const {
619+
if (!extraHeaders.count("Cookie")) { return emptyString; }
620+
return extraHeaders.at("Cookie");
621+
}
622+
616623
bool Downloader::canContinue(const HTTP::URL &link){
617624
if (getStatusCode() == 401){
618625
// retry with authentication

lib/downloader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace HTTP{
2929
bool continueNonBlocking(Util::DataCallback &cb);
3030

3131
std::string getHeader(const std::string &headerName);
32+
const std::string & getCookie() const;
3233
std::string &getStatusText();
3334
uint32_t getStatusCode();
3435
bool isOk(); ///< True if the request was successful.

src/output/output.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ namespace Mist{
133133
if (myConn){
134134
setBlocking(true);
135135
//Make sure that if the socket is a non-stdio socket, we close it when forking
136-
if (myConn.getSocket() > 2){
137-
Util::Procs::socketList.insert(myConn.getSocket());
138-
}
139-
}else{
140-
WARN_MSG("Warning: MistOut created with closed socket!");
136+
if (myConn.getSocket() > 2) { Util::Procs::socketList.insert(myConn.getSocket()); }
141137
}
142138
sentHeader = false;
143139
isRecordingToFile = false;

src/process/process_av.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ namespace Mist{
441441
public:
442442
bool isRecording(){return false;}
443443

444-
ProcessSource(Socket::Connection &c) : Output(c){
445-
closeMyConn();
444+
ProcessSource(Socket::Connection & c) : Output(c) {
446445
targetParams["keeptimes"] = true;
447446
realTime = 0;
448447
convertCtx = NULL;
@@ -458,7 +457,7 @@ namespace Mist{
458457
softDecodeFormat = AV_PIX_FMT_NONE;
459458
hw_decode_ctx = 0;
460459
skippedFrames = 99999; //< Init high so that it does not skip the first keyframe
461-
};
460+
}
462461

463462
~ProcessSource(){
464463
if (convertCtx){
@@ -1863,7 +1862,7 @@ void sourceThread(){
18631862
video_select = Mist::opt["source_track"].asStringRef();
18641863
}
18651864
conf.getOption("target", true).append("-");
1866-
Socket::Connection S(1, 0);
1865+
Socket::Connection S;
18671866
Mist::ProcessSource out(S);
18681867
MEDIUM_MSG("Running source thread...");
18691868
out.run();

0 commit comments

Comments
 (0)