diff --git a/AUTHORS.txt b/AUTHORS.txt index da88e1f0c..b5db85c51 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,7 +1,7 @@ Authors ordered by first contribution. -* winlin -* wenjie.zhao <740936897@qq.com> -* xiangcheng.liu -* naijia.liu -* alcoholyi +* winlin +* wenjie.zhao<740936897@qq.com> +* xiangcheng.liu +* naijia.liu +* alcoholyi diff --git a/README.md b/README.md index c5f28c40a..62006010d 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index a36959554..9b423ad24 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -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 diff --git a/trunk/src/app/srs_app_http.cpp b/trunk/src/app/srs_app_http.cpp index 0494771d2..54d04400e 100644 --- a/trunk/src/app/srs_app_http.cpp +++ b/trunk/src/app/srs_app_http.cpp @@ -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; } diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index bdd54c863..afe9ec085 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -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(); diff --git a/trunk/src/app/srs_app_http_api.hpp b/trunk/src/app/srs_app_http_api.hpp index cc36133dd..bb549950b 100644 --- a/trunk/src/app/srs_app_http_api.hpp +++ b/trunk/src/app/srs_app_http_api.hpp @@ -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: diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index c51587e9a..604d30397 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -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,