mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
add contributors to api/v1/authors
This commit is contained in:
parent
9d5abbd9a6
commit
4a40075f68
7 changed files with 66 additions and 12 deletions
10
AUTHORS.txt
10
AUTHORS.txt
|
@ -1,7 +1,7 @@
|
|||
Authors ordered by first contribution.
|
||||
|
||||
* winlin <winlin@vip.126.com>
|
||||
* wenjie.zhao <740936897@qq.com>
|
||||
* xiangcheng.liu <liuxc0116@foxmail.com>
|
||||
* naijia.liu <youngcow@youngcow.net>
|
||||
* alcoholyi <alcoholyi@qq.com>
|
||||
* winlin<winlin@vip.126.com>
|
||||
* wenjie.zhao<740936897@qq.com>
|
||||
* xiangcheng.liu<liuxc0116@foxmail.com>
|
||||
* naijia.liu<youngcow@youngcow.net>
|
||||
* alcoholyi<alcoholyi@qq.com>
|
||||
|
|
|
@ -63,6 +63,7 @@ The PRIMARY AUTHORS are (and/or have been)(Authors ordered by first contribution
|
|||
About the primary AUTHORS:
|
||||
* Contribute important features to SRS.
|
||||
* Names of all PRIMARY AUTHORS response in NetConnection.connect and metadata.
|
||||
* Names of all CONTRIBUTORS response in api/v1/authors.
|
||||
|
||||
And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
|
||||
people who have submitted patches, reported bugs, added translations, helped
|
||||
|
|
|
@ -576,5 +576,17 @@ echo "" >> $SRS_AUTO_HEADERS_H
|
|||
# prefix
|
||||
echo "#define SRS_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
|
||||
|
||||
echo "" >> $SRS_AUTO_HEADERS_H
|
||||
|
||||
#####################################################################################
|
||||
# generated the contributors from AUTHORS.txt
|
||||
#####################################################################################
|
||||
SRS_CONSTRIBUTORS=`cat ../AUTHORS.txt|grep "*"|awk -F '* ' '{print $2}'`
|
||||
echo "#define SRS_CONSTRIBUTORS \"\\" >> $SRS_AUTO_HEADERS_H
|
||||
for CONTRIBUTOR in $SRS_CONSTRIBUTORS; do
|
||||
echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H
|
||||
done
|
||||
echo "\"" >> $SRS_AUTO_HEADERS_H
|
||||
|
||||
# new empty line to auto headers file.
|
||||
echo "" >> $SRS_AUTO_HEADERS_H
|
||||
|
|
|
@ -445,9 +445,6 @@ int SrsHttpParser::parse_message_imp(SrsSocket* skt)
|
|||
|
||||
// check header size.
|
||||
if (msg->is_complete()) {
|
||||
srs_trace("http request parsed, method=%d, url=%s, content-length=%"PRId64"",
|
||||
msg->method(), msg->url().c_str(), msg->content_length());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -579,7 +576,7 @@ int SrsHttpUri::initialize(std::string _url)
|
|||
srs_info("parse url %s success", purl);
|
||||
|
||||
query = get_uri_field(url, &hp_u, UF_QUERY);
|
||||
srs_trace("parse query %s success", purl);
|
||||
srs_info("parse query %s success", query);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ int SrsApiApi::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
|||
SrsApiV1::SrsApiV1()
|
||||
{
|
||||
handlers.push_back(new SrsApiVersion());
|
||||
handlers.push_back(new SrsApiAuthors());
|
||||
}
|
||||
|
||||
SrsApiV1::~SrsApiV1()
|
||||
|
@ -117,7 +118,8 @@ int SrsApiV1::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
|||
ss << JOBJECT_START
|
||||
<< JFIELD_ERROR(ERROR_SUCCESS) << JFIELD_CONT
|
||||
<< JFIELD_ORG("urls", JOBJECT_START)
|
||||
<< JFIELD_STR("version", "the version of SRS")
|
||||
<< JFIELD_STR("version", "the version of SRS") << JFIELD_CONT
|
||||
<< JFIELD_STR("authors", "the primary authors and contributors")
|
||||
<< JOBJECT_END
|
||||
<< JOBJECT_END;
|
||||
|
||||
|
@ -147,8 +149,36 @@ int SrsApiVersion::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
|||
<< JFIELD_ORG("major", VERSION_MAJOR) << JFIELD_CONT
|
||||
<< JFIELD_ORG("minor", VERSION_MINOR) << JFIELD_CONT
|
||||
<< JFIELD_ORG("revision", VERSION_REVISION) << JFIELD_CONT
|
||||
<< JFIELD_STR("version", RTMP_SIG_SRS_VERSION) << JFIELD_CONT
|
||||
<< JFIELD_STR("primary_authors", RTMP_SIG_SRS_PRIMARY_AUTHROS)
|
||||
<< JFIELD_STR("version", RTMP_SIG_SRS_VERSION)
|
||||
<< JOBJECT_END
|
||||
<< JOBJECT_END;
|
||||
|
||||
return res_json(skt, ss.str());
|
||||
}
|
||||
|
||||
SrsApiAuthors::SrsApiAuthors()
|
||||
{
|
||||
}
|
||||
|
||||
SrsApiAuthors::~SrsApiAuthors()
|
||||
{
|
||||
}
|
||||
|
||||
bool SrsApiAuthors::can_handle(const char* path, int length, const char** /*pchild*/)
|
||||
{
|
||||
return srs_path_equals("/authors", path, length);
|
||||
}
|
||||
|
||||
int SrsApiAuthors::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
ss << JOBJECT_START
|
||||
<< JFIELD_ERROR(ERROR_SUCCESS) << JFIELD_CONT
|
||||
<< JFIELD_ORG("data", JOBJECT_START)
|
||||
<< JFIELD_STR("primary_authors", RTMP_SIG_SRS_PRIMARY_AUTHROS) << JFIELD_CONT
|
||||
<< JFIELD_STR("contributors_link", RTMP_SIG_SRS_CONTRIBUTORS_URL) << JFIELD_CONT
|
||||
<< JFIELD_STR("contributors", SRS_CONSTRIBUTORS)
|
||||
<< JOBJECT_END
|
||||
<< JOBJECT_END;
|
||||
|
||||
|
@ -220,6 +250,9 @@ int SrsHttpApi::process_request(SrsSocket* skt, SrsHttpMessage* req)
|
|||
return ret;
|
||||
}
|
||||
|
||||
srs_trace("http request parsed, method=%d, url=%s, content-length=%"PRId64"",
|
||||
req->method(), req->url().c_str(), req->content_length());
|
||||
|
||||
// TODO: maybe need to parse the url.
|
||||
std::string url = req->path();
|
||||
|
||||
|
|
|
@ -82,6 +82,16 @@ public:
|
|||
virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req);
|
||||
};
|
||||
|
||||
class SrsApiAuthors : public SrsHttpHandler
|
||||
{
|
||||
public:
|
||||
SrsApiAuthors();
|
||||
virtual ~SrsApiAuthors();
|
||||
public:
|
||||
virtual bool can_handle(const char* path, int length, const char** pchild);
|
||||
virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req);
|
||||
};
|
||||
|
||||
class SrsHttpApi : public SrsConnection
|
||||
{
|
||||
private:
|
||||
|
|
|
@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
|
||||
#define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2014 winlin"
|
||||
#define RTMP_SIG_SRS_PRIMARY_AUTHROS "winlin,wenjie.zhao"
|
||||
#define RTMP_SIG_SRS_CONTRIBUTORS_URL "https://github.com/winlinvip/simple-rtmp-server/blob/master/AUTHORS.txt"
|
||||
|
||||
/**
|
||||
* the core provides the common defined macros, utilities,
|
||||
|
|
Loading…
Reference in a new issue