winlin

refine code, rename SrsSocket to SrsStSocket

@@ -306,7 +306,7 @@ int SrsEdgeIngester::connect_server() @@ -306,7 +306,7 @@ int SrsEdgeIngester::connect_server()
306 srs_freep(io); 306 srs_freep(io);
307 307
308 srs_assert(stfd); 308 srs_assert(stfd);
309 - io = new SrsSocket(stfd); 309 + io = new SrsStSocket(stfd);
310 client = new SrsRtmpClient(io); 310 client = new SrsRtmpClient(io);
311 311
312 kbps->set_io(io, io); 312 kbps->set_io(io, io);
@@ -559,7 +559,7 @@ int SrsEdgeForwarder::connect_server() @@ -559,7 +559,7 @@ int SrsEdgeForwarder::connect_server()
559 srs_freep(io); 559 srs_freep(io);
560 560
561 srs_assert(stfd); 561 srs_assert(stfd);
562 - io = new SrsSocket(stfd); 562 + io = new SrsStSocket(stfd);
563 client = new SrsRtmpClient(io); 563 client = new SrsRtmpClient(io);
564 564
565 kbps->set_io(io, io); 565 kbps->set_io(io, io);
@@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #include <srs_app_st.hpp> 33 #include <srs_app_st.hpp>
34 #include <srs_app_thread.hpp> 34 #include <srs_app_thread.hpp>
35 35
36 -class SrsSocket; 36 +class SrsStSocket;
37 class SrsRtmpServer; 37 class SrsRtmpServer;
38 class SrsSource; 38 class SrsSource;
39 class SrsRequest; 39 class SrsRequest;
@@ -266,7 +266,7 @@ int SrsForwarder::connect_server() @@ -266,7 +266,7 @@ int SrsForwarder::connect_server()
266 srs_freep(io); 266 srs_freep(io);
267 267
268 srs_assert(stfd); 268 srs_assert(stfd);
269 - io = new SrsSocket(stfd); 269 + io = new SrsStSocket(stfd);
270 client = new SrsRtmpClient(io); 270 client = new SrsRtmpClient(io);
271 271
272 kbps->set_io(io, io); 272 kbps->set_io(io, io);
@@ -97,7 +97,7 @@ bool SrsHttpHandler::can_handle(const char* /*path*/, int /*length*/, const char @@ -97,7 +97,7 @@ bool SrsHttpHandler::can_handle(const char* /*path*/, int /*length*/, const char
97 return false; 97 return false;
98 } 98 }
99 99
100 -int SrsHttpHandler::process_request(SrsSocket* skt, SrsHttpMessage* req) 100 +int SrsHttpHandler::process_request(SrsStSocket* skt, SrsHttpMessage* req)
101 { 101 {
102 if (req->method() == SRS_CONSTS_HTTP_OPTIONS) { 102 if (req->method() == SRS_CONSTS_HTTP_OPTIONS) {
103 req->set_requires_crossdomain(true); 103 req->set_requires_crossdomain(true);
@@ -136,13 +136,13 @@ bool SrsHttpHandler::is_handler_valid(SrsHttpMessage* req, int& status_code, str @@ -136,13 +136,13 @@ bool SrsHttpHandler::is_handler_valid(SrsHttpMessage* req, int& status_code, str
136 return true; 136 return true;
137 } 137 }
138 138
139 -int SrsHttpHandler::do_process_request(SrsSocket* /*skt*/, SrsHttpMessage* /*req*/) 139 +int SrsHttpHandler::do_process_request(SrsStSocket* /*skt*/, SrsHttpMessage* /*req*/)
140 { 140 {
141 int ret = ERROR_SUCCESS; 141 int ret = ERROR_SUCCESS;
142 return ret; 142 return ret;
143 } 143 }
144 144
145 -int SrsHttpHandler::response_error(SrsSocket* skt, SrsHttpMessage* req, int code, string desc) 145 +int SrsHttpHandler::response_error(SrsStSocket* skt, SrsHttpMessage* req, int code, string desc)
146 { 146 {
147 std::stringstream ss; 147 std::stringstream ss;
148 ss << __SRS_JOBJECT_START 148 ss << __SRS_JOBJECT_START
@@ -334,12 +334,12 @@ SrsHttpHandler* SrsHttpHandler::res_body(stringstream& ss, string body) @@ -334,12 +334,12 @@ SrsHttpHandler* SrsHttpHandler::res_body(stringstream& ss, string body)
334 return this; 334 return this;
335 } 335 }
336 336
337 -int SrsHttpHandler::res_flush(SrsSocket* skt, stringstream& ss) 337 +int SrsHttpHandler::res_flush(SrsStSocket* skt, stringstream& ss)
338 { 338 {
339 return skt->write((void*)ss.str().c_str(), ss.str().length(), NULL); 339 return skt->write((void*)ss.str().c_str(), ss.str().length(), NULL);
340 } 340 }
341 341
342 -int SrsHttpHandler::res_options(SrsSocket* skt) 342 +int SrsHttpHandler::res_options(SrsStSocket* skt)
343 { 343 {
344 std::stringstream ss; 344 std::stringstream ss;
345 345
@@ -350,7 +350,7 @@ int SrsHttpHandler::res_options(SrsSocket* skt) @@ -350,7 +350,7 @@ int SrsHttpHandler::res_options(SrsSocket* skt)
350 return res_flush(skt, ss); 350 return res_flush(skt, ss);
351 } 351 }
352 352
353 -int SrsHttpHandler::res_text(SrsSocket* skt, SrsHttpMessage* req, string body) 353 +int SrsHttpHandler::res_text(SrsStSocket* skt, SrsHttpMessage* req, string body)
354 { 354 {
355 std::stringstream ss; 355 std::stringstream ss;
356 356
@@ -367,7 +367,7 @@ int SrsHttpHandler::res_text(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -367,7 +367,7 @@ int SrsHttpHandler::res_text(SrsSocket* skt, SrsHttpMessage* req, string body)
367 return res_flush(skt, ss); 367 return res_flush(skt, ss);
368 } 368 }
369 369
370 -int SrsHttpHandler::res_xml(SrsSocket* skt, SrsHttpMessage* req, string body) 370 +int SrsHttpHandler::res_xml(SrsStSocket* skt, SrsHttpMessage* req, string body)
371 { 371 {
372 std::stringstream ss; 372 std::stringstream ss;
373 373
@@ -384,7 +384,7 @@ int SrsHttpHandler::res_xml(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -384,7 +384,7 @@ int SrsHttpHandler::res_xml(SrsSocket* skt, SrsHttpMessage* req, string body)
384 return res_flush(skt, ss); 384 return res_flush(skt, ss);
385 } 385 }
386 386
387 -int SrsHttpHandler::res_javascript(SrsSocket* skt, SrsHttpMessage* req, string body) 387 +int SrsHttpHandler::res_javascript(SrsStSocket* skt, SrsHttpMessage* req, string body)
388 { 388 {
389 std::stringstream ss; 389 std::stringstream ss;
390 390
@@ -401,7 +401,7 @@ int SrsHttpHandler::res_javascript(SrsSocket* skt, SrsHttpMessage* req, string b @@ -401,7 +401,7 @@ int SrsHttpHandler::res_javascript(SrsSocket* skt, SrsHttpMessage* req, string b
401 return res_flush(skt, ss); 401 return res_flush(skt, ss);
402 } 402 }
403 403
404 -int SrsHttpHandler::res_swf(SrsSocket* skt, SrsHttpMessage* req, string body) 404 +int SrsHttpHandler::res_swf(SrsStSocket* skt, SrsHttpMessage* req, string body)
405 { 405 {
406 std::stringstream ss; 406 std::stringstream ss;
407 407
@@ -418,7 +418,7 @@ int SrsHttpHandler::res_swf(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -418,7 +418,7 @@ int SrsHttpHandler::res_swf(SrsSocket* skt, SrsHttpMessage* req, string body)
418 return res_flush(skt, ss); 418 return res_flush(skt, ss);
419 } 419 }
420 420
421 -int SrsHttpHandler::res_css(SrsSocket* skt, SrsHttpMessage* req, string body) 421 +int SrsHttpHandler::res_css(SrsStSocket* skt, SrsHttpMessage* req, string body)
422 { 422 {
423 std::stringstream ss; 423 std::stringstream ss;
424 424
@@ -435,7 +435,7 @@ int SrsHttpHandler::res_css(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -435,7 +435,7 @@ int SrsHttpHandler::res_css(SrsSocket* skt, SrsHttpMessage* req, string body)
435 return res_flush(skt, ss); 435 return res_flush(skt, ss);
436 } 436 }
437 437
438 -int SrsHttpHandler::res_ico(SrsSocket* skt, SrsHttpMessage* req, string body) 438 +int SrsHttpHandler::res_ico(SrsStSocket* skt, SrsHttpMessage* req, string body)
439 { 439 {
440 std::stringstream ss; 440 std::stringstream ss;
441 441
@@ -452,7 +452,7 @@ int SrsHttpHandler::res_ico(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -452,7 +452,7 @@ int SrsHttpHandler::res_ico(SrsSocket* skt, SrsHttpMessage* req, string body)
452 return res_flush(skt, ss); 452 return res_flush(skt, ss);
453 } 453 }
454 454
455 -int SrsHttpHandler::res_m3u8(SrsSocket* skt, SrsHttpMessage* req, string body) 455 +int SrsHttpHandler::res_m3u8(SrsStSocket* skt, SrsHttpMessage* req, string body)
456 { 456 {
457 std::stringstream ss; 457 std::stringstream ss;
458 458
@@ -469,7 +469,7 @@ int SrsHttpHandler::res_m3u8(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -469,7 +469,7 @@ int SrsHttpHandler::res_m3u8(SrsSocket* skt, SrsHttpMessage* req, string body)
469 return res_flush(skt, ss); 469 return res_flush(skt, ss);
470 } 470 }
471 471
472 -int SrsHttpHandler::res_mpegts(SrsSocket* skt, SrsHttpMessage* req, string body) 472 +int SrsHttpHandler::res_mpegts(SrsStSocket* skt, SrsHttpMessage* req, string body)
473 { 473 {
474 std::stringstream ss; 474 std::stringstream ss;
475 475
@@ -486,7 +486,7 @@ int SrsHttpHandler::res_mpegts(SrsSocket* skt, SrsHttpMessage* req, string body) @@ -486,7 +486,7 @@ int SrsHttpHandler::res_mpegts(SrsSocket* skt, SrsHttpMessage* req, string body)
486 return res_flush(skt, ss); 486 return res_flush(skt, ss);
487 } 487 }
488 488
489 -int SrsHttpHandler::res_json(SrsSocket* skt, SrsHttpMessage* req, string json) 489 +int SrsHttpHandler::res_json(SrsStSocket* skt, SrsHttpMessage* req, string json)
490 { 490 {
491 std::stringstream ss; 491 std::stringstream ss;
492 492
@@ -503,7 +503,7 @@ int SrsHttpHandler::res_json(SrsSocket* skt, SrsHttpMessage* req, string json) @@ -503,7 +503,7 @@ int SrsHttpHandler::res_json(SrsSocket* skt, SrsHttpMessage* req, string json)
503 return res_flush(skt, ss); 503 return res_flush(skt, ss);
504 } 504 }
505 505
506 -int SrsHttpHandler::res_error(SrsSocket* skt, SrsHttpMessage* req, int code, string reason_phrase, string body) 506 +int SrsHttpHandler::res_error(SrsStSocket* skt, SrsHttpMessage* req, int code, string reason_phrase, string body)
507 { 507 {
508 std::stringstream ss; 508 std::stringstream ss;
509 509
@@ -829,7 +829,7 @@ int SrsHttpParser::initialize(enum http_parser_type type) @@ -829,7 +829,7 @@ int SrsHttpParser::initialize(enum http_parser_type type)
829 return ret; 829 return ret;
830 } 830 }
831 831
832 -int SrsHttpParser::parse_message(SrsSocket* skt, SrsHttpMessage** ppmsg) 832 +int SrsHttpParser::parse_message(SrsStSocket* skt, SrsHttpMessage** ppmsg)
833 { 833 {
834 *ppmsg = NULL; 834 *ppmsg = NULL;
835 835
@@ -861,7 +861,7 @@ int SrsHttpParser::parse_message(SrsSocket* skt, SrsHttpMessage** ppmsg) @@ -861,7 +861,7 @@ int SrsHttpParser::parse_message(SrsSocket* skt, SrsHttpMessage** ppmsg)
861 return ret; 861 return ret;
862 } 862 }
863 863
864 -int SrsHttpParser::parse_message_imp(SrsSocket* skt) 864 +int SrsHttpParser::parse_message_imp(SrsStSocket* skt)
865 { 865 {
866 int ret = ERROR_SUCCESS; 866 int ret = ERROR_SUCCESS;
867 867
@@ -41,7 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -41,7 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 41
42 class SrsBuffer; 42 class SrsBuffer;
43 class SrsRequest; 43 class SrsRequest;
44 -class SrsSocket; 44 +class SrsStSocket;
45 class SrsHttpUri; 45 class SrsHttpUri;
46 class SrsHttpMessage; 46 class SrsHttpMessage;
47 class SrsHttpHandler; 47 class SrsHttpHandler;
@@ -123,7 +123,7 @@ public: @@ -123,7 +123,7 @@ public:
123 * use the handler to process the request. 123 * use the handler to process the request.
124 * @remark sub classes should override the do_process_request. 124 * @remark sub classes should override the do_process_request.
125 */ 125 */
126 - virtual int process_request(SrsSocket* skt, SrsHttpMessage* req); 126 + virtual int process_request(SrsStSocket* skt, SrsHttpMessage* req);
127 public: 127 public:
128 /** 128 /**
129 * find the best matched handler 129 * find the best matched handler
@@ -143,12 +143,12 @@ protected: @@ -143,12 +143,12 @@ protected:
143 * do the actual process of request., format as, for example: 143 * do the actual process of request., format as, for example:
144 * {"code":0, "data":{}} 144 * {"code":0, "data":{}}
145 */ 145 */
146 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 146 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
147 /** 147 /**
148 * response error, format as, for example: 148 * response error, format as, for example:
149 * {"code":100, "desc":"description"} 149 * {"code":100, "desc":"description"}
150 */ 150 */
151 - virtual int response_error(SrsSocket* skt, SrsHttpMessage* req, int code, std::string desc); 151 + virtual int response_error(SrsStSocket* skt, SrsHttpMessage* req, int code, std::string desc);
152 // response writer 152 // response writer
153 public: 153 public:
154 virtual SrsHttpHandler* res_status_line(std::stringstream& ss); 154 virtual SrsHttpHandler* res_status_line(std::stringstream& ss);
@@ -167,19 +167,19 @@ public: @@ -167,19 +167,19 @@ public:
167 virtual SrsHttpHandler* res_enable_crossdomain(std::stringstream& ss); 167 virtual SrsHttpHandler* res_enable_crossdomain(std::stringstream& ss);
168 virtual SrsHttpHandler* res_header_eof(std::stringstream& ss); 168 virtual SrsHttpHandler* res_header_eof(std::stringstream& ss);
169 virtual SrsHttpHandler* res_body(std::stringstream& ss, std::string body); 169 virtual SrsHttpHandler* res_body(std::stringstream& ss, std::string body);
170 - virtual int res_flush(SrsSocket* skt, std::stringstream& ss); 170 + virtual int res_flush(SrsStSocket* skt, std::stringstream& ss);
171 public: 171 public:
172 - virtual int res_options(SrsSocket* skt);  
173 - virtual int res_text(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
174 - virtual int res_xml(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
175 - virtual int res_javascript(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
176 - virtual int res_swf(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
177 - virtual int res_css(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
178 - virtual int res_ico(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
179 - virtual int res_m3u8(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
180 - virtual int res_mpegts(SrsSocket* skt, SrsHttpMessage* req, std::string body);  
181 - virtual int res_json(SrsSocket* skt, SrsHttpMessage* req, std::string json);  
182 - virtual int res_error(SrsSocket* skt, SrsHttpMessage* req, int code, std::string reason_phrase, std::string body); 172 + virtual int res_options(SrsStSocket* skt);
  173 + virtual int res_text(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  174 + virtual int res_xml(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  175 + virtual int res_javascript(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  176 + virtual int res_swf(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  177 + virtual int res_css(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  178 + virtual int res_ico(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  179 + virtual int res_m3u8(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  180 + virtual int res_mpegts(SrsStSocket* skt, SrsHttpMessage* req, std::string body);
  181 + virtual int res_json(SrsStSocket* skt, SrsHttpMessage* req, std::string json);
  182 + virtual int res_error(SrsStSocket* skt, SrsHttpMessage* req, int code, std::string reason_phrase, std::string body);
183 // object creator 183 // object creator
184 public: 184 public:
185 /** 185 /**
@@ -313,12 +313,12 @@ public: @@ -313,12 +313,12 @@ public:
313 * or error and *ppmsg must be NULL. 313 * or error and *ppmsg must be NULL.
314 * @remark, if success, *ppmsg always NOT-NULL, *ppmsg always is_complete(). 314 * @remark, if success, *ppmsg always NOT-NULL, *ppmsg always is_complete().
315 */ 315 */
316 - virtual int parse_message(SrsSocket* skt, SrsHttpMessage** ppmsg); 316 + virtual int parse_message(SrsStSocket* skt, SrsHttpMessage** ppmsg);
317 private: 317 private:
318 /** 318 /**
319 * parse the HTTP message to member field: msg. 319 * parse the HTTP message to member field: msg.
320 */ 320 */
321 - virtual int parse_message_imp(SrsSocket* skt); 321 + virtual int parse_message_imp(SrsStSocket* skt);
322 private: 322 private:
323 static int on_message_begin(http_parser* parser); 323 static int on_message_begin(http_parser* parser);
324 static int on_headers_complete(http_parser* parser); 324 static int on_headers_complete(http_parser* parser);
@@ -72,7 +72,7 @@ bool SrsApiRoot::can_handle(const char* path, int length, const char** pchild) @@ -72,7 +72,7 @@ bool SrsApiRoot::can_handle(const char* path, int length, const char** pchild)
72 return srs_path_equals("/", path, 1); 72 return srs_path_equals("/", path, 1);
73 } 73 }
74 74
75 -int SrsApiRoot::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 75 +int SrsApiRoot::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
76 { 76 {
77 std::stringstream ss; 77 std::stringstream ss;
78 78
@@ -100,7 +100,7 @@ bool SrsApiApi::can_handle(const char* path, int length, const char** /*pchild*/ @@ -100,7 +100,7 @@ bool SrsApiApi::can_handle(const char* path, int length, const char** /*pchild*/
100 return srs_path_equals("/api", path, length); 100 return srs_path_equals("/api", path, length);
101 } 101 }
102 102
103 -int SrsApiApi::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 103 +int SrsApiApi::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
104 { 104 {
105 std::stringstream ss; 105 std::stringstream ss;
106 106
@@ -135,7 +135,7 @@ bool SrsApiV1::can_handle(const char* path, int length, const char** /*pchild*/) @@ -135,7 +135,7 @@ bool SrsApiV1::can_handle(const char* path, int length, const char** /*pchild*/)
135 return srs_path_equals("/v1", path, length); 135 return srs_path_equals("/v1", path, length);
136 } 136 }
137 137
138 -int SrsApiV1::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 138 +int SrsApiV1::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
139 { 139 {
140 std::stringstream ss; 140 std::stringstream ss;
141 141
@@ -169,7 +169,7 @@ bool SrsApiRequests::can_handle(const char* path, int length, const char** /*pch @@ -169,7 +169,7 @@ bool SrsApiRequests::can_handle(const char* path, int length, const char** /*pch
169 return srs_path_equals("/requests", path, length); 169 return srs_path_equals("/requests", path, length);
170 } 170 }
171 171
172 -int SrsApiRequests::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 172 +int SrsApiRequests::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
173 { 173 {
174 std::stringstream ss; 174 std::stringstream ss;
175 175
@@ -233,7 +233,7 @@ bool SrsApiVersion::can_handle(const char* path, int length, const char** /*pchi @@ -233,7 +233,7 @@ bool SrsApiVersion::can_handle(const char* path, int length, const char** /*pchi
233 return srs_path_equals("/versions", path, length); 233 return srs_path_equals("/versions", path, length);
234 } 234 }
235 235
236 -int SrsApiVersion::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 236 +int SrsApiVersion::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
237 { 237 {
238 std::stringstream ss; 238 std::stringstream ss;
239 239
@@ -263,7 +263,7 @@ bool SrsApiSummaries::can_handle(const char* path, int length, const char** /*pc @@ -263,7 +263,7 @@ bool SrsApiSummaries::can_handle(const char* path, int length, const char** /*pc
263 return srs_path_equals("/summaries", path, length); 263 return srs_path_equals("/summaries", path, length);
264 } 264 }
265 265
266 -int SrsApiSummaries::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 266 +int SrsApiSummaries::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
267 { 267 {
268 std::stringstream ss; 268 std::stringstream ss;
269 srs_api_dump_summaries(ss); 269 srs_api_dump_summaries(ss);
@@ -283,7 +283,7 @@ bool SrsApiRusages::can_handle(const char* path, int length, const char** /*pchi @@ -283,7 +283,7 @@ bool SrsApiRusages::can_handle(const char* path, int length, const char** /*pchi
283 return srs_path_equals("/rusages", path, length); 283 return srs_path_equals("/rusages", path, length);
284 } 284 }
285 285
286 -int SrsApiRusages::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 286 +int SrsApiRusages::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
287 { 287 {
288 std::stringstream ss; 288 std::stringstream ss;
289 289
@@ -329,7 +329,7 @@ bool SrsApiSelfProcStats::can_handle(const char* path, int length, const char** @@ -329,7 +329,7 @@ bool SrsApiSelfProcStats::can_handle(const char* path, int length, const char**
329 return srs_path_equals("/self_proc_stats", path, length); 329 return srs_path_equals("/self_proc_stats", path, length);
330 } 330 }
331 331
332 -int SrsApiSelfProcStats::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 332 +int SrsApiSelfProcStats::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
333 { 333 {
334 std::stringstream ss; 334 std::stringstream ss;
335 335
@@ -404,7 +404,7 @@ bool SrsApiSystemProcStats::can_handle(const char* path, int length, const char* @@ -404,7 +404,7 @@ bool SrsApiSystemProcStats::can_handle(const char* path, int length, const char*
404 return srs_path_equals("/system_proc_stats", path, length); 404 return srs_path_equals("/system_proc_stats", path, length);
405 } 405 }
406 406
407 -int SrsApiSystemProcStats::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 407 +int SrsApiSystemProcStats::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
408 { 408 {
409 std::stringstream ss; 409 std::stringstream ss;
410 410
@@ -444,7 +444,7 @@ bool SrsApiMemInfos::can_handle(const char* path, int length, const char** /*pch @@ -444,7 +444,7 @@ bool SrsApiMemInfos::can_handle(const char* path, int length, const char** /*pch
444 return srs_path_equals("/meminfos", path, length); 444 return srs_path_equals("/meminfos", path, length);
445 } 445 }
446 446
447 -int SrsApiMemInfos::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 447 +int SrsApiMemInfos::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
448 { 448 {
449 std::stringstream ss; 449 std::stringstream ss;
450 450
@@ -485,7 +485,7 @@ bool SrsApiAuthors::can_handle(const char* path, int length, const char** /*pchi @@ -485,7 +485,7 @@ bool SrsApiAuthors::can_handle(const char* path, int length, const char** /*pchi
485 return srs_path_equals("/authors", path, length); 485 return srs_path_equals("/authors", path, length);
486 } 486 }
487 487
488 -int SrsApiAuthors::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 488 +int SrsApiAuthors::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
489 { 489 {
490 std::stringstream ss; 490 std::stringstream ss;
491 491
@@ -544,7 +544,7 @@ int SrsHttpApi::do_cycle() @@ -544,7 +544,7 @@ int SrsHttpApi::do_cycle()
544 } 544 }
545 545
546 // underlayer socket 546 // underlayer socket
547 - SrsSocket skt(stfd); 547 + SrsStSocket skt(stfd);
548 548
549 // process http messages. 549 // process http messages.
550 for (;;) { 550 for (;;) {
@@ -571,7 +571,7 @@ int SrsHttpApi::do_cycle() @@ -571,7 +571,7 @@ int SrsHttpApi::do_cycle()
571 return ret; 571 return ret;
572 } 572 }
573 573
574 -int SrsHttpApi::process_request(SrsSocket* skt, SrsHttpMessage* req) 574 +int SrsHttpApi::process_request(SrsStSocket* skt, SrsHttpMessage* req)
575 { 575 {
576 int ret = ERROR_SUCCESS; 576 int ret = ERROR_SUCCESS;
577 577
@@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 32
33 #ifdef SRS_AUTO_HTTP_API 33 #ifdef SRS_AUTO_HTTP_API
34 34
35 -class SrsSocket; 35 +class SrsStSocket;
36 class SrsHttpMessage; 36 class SrsHttpMessage;
37 class SrsHttpParser; 37 class SrsHttpParser;
38 class SrsHttpHandler; 38 class SrsHttpHandler;
@@ -51,7 +51,7 @@ public: @@ -51,7 +51,7 @@ public:
51 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase); 51 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase);
52 protected: 52 protected:
53 virtual bool can_handle(const char* path, int length, const char** pchild); 53 virtual bool can_handle(const char* path, int length, const char** pchild);
54 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 54 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
55 }; 55 };
56 56
57 class SrsApiApi : public SrsHttpHandler 57 class SrsApiApi : public SrsHttpHandler
@@ -62,7 +62,7 @@ public: @@ -62,7 +62,7 @@ public:
62 public: 62 public:
63 virtual bool can_handle(const char* path, int length, const char** pchild); 63 virtual bool can_handle(const char* path, int length, const char** pchild);
64 protected: 64 protected:
65 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 65 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
66 }; 66 };
67 67
68 class SrsApiV1 : public SrsHttpHandler 68 class SrsApiV1 : public SrsHttpHandler
@@ -73,7 +73,7 @@ public: @@ -73,7 +73,7 @@ public:
73 public: 73 public:
74 virtual bool can_handle(const char* path, int length, const char** pchild); 74 virtual bool can_handle(const char* path, int length, const char** pchild);
75 protected: 75 protected:
76 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 76 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
77 }; 77 };
78 78
79 class SrsApiRequests : public SrsHttpHandler 79 class SrsApiRequests : public SrsHttpHandler
@@ -84,7 +84,7 @@ public: @@ -84,7 +84,7 @@ public:
84 public: 84 public:
85 virtual bool can_handle(const char* path, int length, const char** pchild); 85 virtual bool can_handle(const char* path, int length, const char** pchild);
86 protected: 86 protected:
87 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 87 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
88 }; 88 };
89 89
90 class SrsApiVersion : public SrsHttpHandler 90 class SrsApiVersion : public SrsHttpHandler
@@ -95,7 +95,7 @@ public: @@ -95,7 +95,7 @@ public:
95 public: 95 public:
96 virtual bool can_handle(const char* path, int length, const char** pchild); 96 virtual bool can_handle(const char* path, int length, const char** pchild);
97 protected: 97 protected:
98 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 98 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
99 }; 99 };
100 100
101 class SrsApiSummaries : public SrsHttpHandler 101 class SrsApiSummaries : public SrsHttpHandler
@@ -106,7 +106,7 @@ public: @@ -106,7 +106,7 @@ public:
106 public: 106 public:
107 virtual bool can_handle(const char* path, int length, const char** pchild); 107 virtual bool can_handle(const char* path, int length, const char** pchild);
108 protected: 108 protected:
109 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 109 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
110 }; 110 };
111 111
112 class SrsApiRusages : public SrsHttpHandler 112 class SrsApiRusages : public SrsHttpHandler
@@ -117,7 +117,7 @@ public: @@ -117,7 +117,7 @@ public:
117 public: 117 public:
118 virtual bool can_handle(const char* path, int length, const char** pchild); 118 virtual bool can_handle(const char* path, int length, const char** pchild);
119 protected: 119 protected:
120 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 120 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
121 }; 121 };
122 122
123 class SrsApiSelfProcStats : public SrsHttpHandler 123 class SrsApiSelfProcStats : public SrsHttpHandler
@@ -128,7 +128,7 @@ public: @@ -128,7 +128,7 @@ public:
128 public: 128 public:
129 virtual bool can_handle(const char* path, int length, const char** pchild); 129 virtual bool can_handle(const char* path, int length, const char** pchild);
130 protected: 130 protected:
131 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 131 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
132 }; 132 };
133 133
134 class SrsApiSystemProcStats : public SrsHttpHandler 134 class SrsApiSystemProcStats : public SrsHttpHandler
@@ -139,7 +139,7 @@ public: @@ -139,7 +139,7 @@ public:
139 public: 139 public:
140 virtual bool can_handle(const char* path, int length, const char** pchild); 140 virtual bool can_handle(const char* path, int length, const char** pchild);
141 protected: 141 protected:
142 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 142 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
143 }; 143 };
144 144
145 class SrsApiMemInfos : public SrsHttpHandler 145 class SrsApiMemInfos : public SrsHttpHandler
@@ -150,7 +150,7 @@ public: @@ -150,7 +150,7 @@ public:
150 public: 150 public:
151 virtual bool can_handle(const char* path, int length, const char** pchild); 151 virtual bool can_handle(const char* path, int length, const char** pchild);
152 protected: 152 protected:
153 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 153 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
154 }; 154 };
155 155
156 class SrsApiAuthors : public SrsHttpHandler 156 class SrsApiAuthors : public SrsHttpHandler
@@ -161,7 +161,7 @@ public: @@ -161,7 +161,7 @@ public:
161 public: 161 public:
162 virtual bool can_handle(const char* path, int length, const char** pchild); 162 virtual bool can_handle(const char* path, int length, const char** pchild);
163 protected: 163 protected:
164 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 164 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
165 }; 165 };
166 166
167 class SrsHttpApi : public SrsConnection 167 class SrsHttpApi : public SrsConnection
@@ -182,7 +182,7 @@ public: @@ -182,7 +182,7 @@ public:
182 protected: 182 protected:
183 virtual int do_cycle(); 183 virtual int do_cycle();
184 private: 184 private:
185 - virtual int process_request(SrsSocket* skt, SrsHttpMessage* req); 185 + virtual int process_request(SrsStSocket* skt, SrsHttpMessage* req);
186 }; 186 };
187 187
188 #endif 188 #endif
@@ -85,7 +85,7 @@ int SrsHttpClient::post(SrsHttpUri* uri, string req, string& res) @@ -85,7 +85,7 @@ int SrsHttpClient::post(SrsHttpUri* uri, string req, string& res)
85 << __SRS_CRLF 85 << __SRS_CRLF
86 << req; 86 << req;
87 87
88 - SrsSocket skt(stfd); 88 + SrsStSocket skt(stfd);
89 89
90 std::string data = ss.str(); 90 std::string data = ss.str();
91 if ((ret = skt.write((void*)data.c_str(), data.length(), NULL)) != ERROR_SUCCESS) { 91 if ((ret = skt.write((void*)data.c_str(), data.length(), NULL)) != ERROR_SUCCESS) {
@@ -124,7 +124,7 @@ bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::s @@ -124,7 +124,7 @@ bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::s
124 return false; 124 return false;
125 } 125 }
126 126
127 -int SrsHttpRoot::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 127 +int SrsHttpRoot::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
128 { 128 {
129 int ret = ERROR_SUCCESS; 129 int ret = ERROR_SUCCESS;
130 return ret; 130 return ret;
@@ -161,7 +161,7 @@ bool SrsHttpVhost::is_handler_valid(SrsHttpMessage* req, int& status_code, std:: @@ -161,7 +161,7 @@ bool SrsHttpVhost::is_handler_valid(SrsHttpMessage* req, int& status_code, std::
161 return true; 161 return true;
162 } 162 }
163 163
164 -int SrsHttpVhost::do_process_request(SrsSocket* skt, SrsHttpMessage* req) 164 +int SrsHttpVhost::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
165 { 165 {
166 int ret = ERROR_SUCCESS; 166 int ret = ERROR_SUCCESS;
167 167
@@ -188,7 +188,7 @@ int SrsHttpVhost::do_process_request(SrsSocket* skt, SrsHttpMessage* req) @@ -188,7 +188,7 @@ int SrsHttpVhost::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
188 return ret; 188 return ret;
189 } 189 }
190 190
191 -int SrsHttpVhost::response_regular_file(SrsSocket* skt, SrsHttpMessage* req, string fullpath) 191 +int SrsHttpVhost::response_regular_file(SrsStSocket* skt, SrsHttpMessage* req, string fullpath)
192 { 192 {
193 int ret = ERROR_SUCCESS; 193 int ret = ERROR_SUCCESS;
194 194
@@ -235,7 +235,7 @@ int SrsHttpVhost::response_regular_file(SrsSocket* skt, SrsHttpMessage* req, str @@ -235,7 +235,7 @@ int SrsHttpVhost::response_regular_file(SrsSocket* skt, SrsHttpMessage* req, str
235 return ret; 235 return ret;
236 } 236 }
237 237
238 -int SrsHttpVhost::response_flv_file(SrsSocket* skt, SrsHttpMessage* req, string fullpath) 238 +int SrsHttpVhost::response_flv_file(SrsStSocket* skt, SrsHttpMessage* req, string fullpath)
239 { 239 {
240 int ret = ERROR_SUCCESS; 240 int ret = ERROR_SUCCESS;
241 241
@@ -286,7 +286,7 @@ int SrsHttpVhost::response_flv_file(SrsSocket* skt, SrsHttpMessage* req, string @@ -286,7 +286,7 @@ int SrsHttpVhost::response_flv_file(SrsSocket* skt, SrsHttpMessage* req, string
286 return ret; 286 return ret;
287 } 287 }
288 288
289 -int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string fullpath, int offset) 289 +int SrsHttpVhost::response_flv_file2(SrsStSocket* skt, SrsHttpMessage* req, string fullpath, int offset)
290 { 290 {
291 int ret = ERROR_SUCCESS; 291 int ret = ERROR_SUCCESS;
292 292
@@ -390,7 +390,7 @@ int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string @@ -390,7 +390,7 @@ int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string
390 return ret; 390 return ret;
391 } 391 }
392 392
393 -int SrsHttpVhost::response_ts_file(SrsSocket* skt, SrsHttpMessage* req, string fullpath) 393 +int SrsHttpVhost::response_ts_file(SrsStSocket* skt, SrsHttpMessage* req, string fullpath)
394 { 394 {
395 int ret = ERROR_SUCCESS; 395 int ret = ERROR_SUCCESS;
396 396
@@ -524,7 +524,7 @@ int SrsHttpConn::do_cycle() @@ -524,7 +524,7 @@ int SrsHttpConn::do_cycle()
524 } 524 }
525 525
526 // underlayer socket 526 // underlayer socket
527 - SrsSocket skt(stfd); 527 + SrsStSocket skt(stfd);
528 528
529 // process http messages. 529 // process http messages.
530 for (;;) { 530 for (;;) {
@@ -551,7 +551,7 @@ int SrsHttpConn::do_cycle() @@ -551,7 +551,7 @@ int SrsHttpConn::do_cycle()
551 return ret; 551 return ret;
552 } 552 }
553 553
554 -int SrsHttpConn::process_request(SrsSocket* skt, SrsHttpMessage* req) 554 +int SrsHttpConn::process_request(SrsStSocket* skt, SrsHttpMessage* req)
555 { 555 {
556 int ret = ERROR_SUCCESS; 556 int ret = ERROR_SUCCESS;
557 557
@@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 #include <srs_app_conn.hpp> 36 #include <srs_app_conn.hpp>
37 #include <srs_app_http.hpp> 37 #include <srs_app_http.hpp>
38 38
39 -class SrsSocket; 39 +class SrsStSocket;
40 class SrsHttpParser; 40 class SrsHttpParser;
41 class SrsHttpMessage; 41 class SrsHttpMessage;
42 class SrsHttpHandler; 42 class SrsHttpHandler;
@@ -52,7 +52,7 @@ public: @@ -52,7 +52,7 @@ public:
52 virtual int best_match(const char* path, int length, SrsHttpHandlerMatch** ppmatch); 52 virtual int best_match(const char* path, int length, SrsHttpHandlerMatch** ppmatch);
53 protected: 53 protected:
54 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase); 54 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase);
55 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 55 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
56 }; 56 };
57 57
58 class SrsHttpVhost : public SrsHttpHandler 58 class SrsHttpVhost : public SrsHttpHandler
@@ -68,12 +68,12 @@ public: @@ -68,12 +68,12 @@ public:
68 virtual bool can_handle(const char* path, int length, const char** pchild); 68 virtual bool can_handle(const char* path, int length, const char** pchild);
69 protected: 69 protected:
70 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase); 70 virtual bool is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase);
71 - virtual int do_process_request(SrsSocket* skt, SrsHttpMessage* req); 71 + virtual int do_process_request(SrsStSocket* skt, SrsHttpMessage* req);
72 private: 72 private:
73 - virtual int response_regular_file(SrsSocket* skt, SrsHttpMessage* req, std::string fullpath);  
74 - virtual int response_flv_file(SrsSocket* skt, SrsHttpMessage* req, std::string fullpath);  
75 - virtual int response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, std::string fullpath, int offset);  
76 - virtual int response_ts_file(SrsSocket* skt, SrsHttpMessage* req, std::string fullpath); 73 + virtual int response_regular_file(SrsStSocket* skt, SrsHttpMessage* req, std::string fullpath);
  74 + virtual int response_flv_file(SrsStSocket* skt, SrsHttpMessage* req, std::string fullpath);
  75 + virtual int response_flv_file2(SrsStSocket* skt, SrsHttpMessage* req, std::string fullpath, int offset);
  76 + virtual int response_ts_file(SrsStSocket* skt, SrsHttpMessage* req, std::string fullpath);
77 virtual std::string get_request_file(SrsHttpMessage* req); 77 virtual std::string get_request_file(SrsHttpMessage* req);
78 public: 78 public:
79 virtual std::string vhost(); 79 virtual std::string vhost();
@@ -99,7 +99,7 @@ public: @@ -99,7 +99,7 @@ public:
99 protected: 99 protected:
100 virtual int do_cycle(); 100 virtual int do_cycle();
101 private: 101 private:
102 - virtual int process_request(SrsSocket* skt, SrsHttpMessage* req); 102 + virtual int process_request(SrsStSocket* skt, SrsHttpMessage* req);
103 }; 103 };
104 104
105 #endif 105 #endif
@@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 #include <http_parser.h> 36 #include <http_parser.h>
37 37
38 class SrsHttpUri; 38 class SrsHttpUri;
39 -class SrsSocket; 39 +class SrsStSocket;
40 class SrsRequest; 40 class SrsRequest;
41 class SrsHttpParser; 41 class SrsHttpParser;
42 class SrsFlvSegment; 42 class SrsFlvSegment;
@@ -79,7 +79,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd) @@ -79,7 +79,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd)
79 { 79 {
80 req = new SrsRequest(); 80 req = new SrsRequest();
81 res = new SrsResponse(); 81 res = new SrsResponse();
82 - skt = new SrsSocket(client_stfd); 82 + skt = new SrsStSocket(client_stfd);
83 rtmp = new SrsRtmpServer(skt); 83 rtmp = new SrsRtmpServer(skt);
84 refer = new SrsRefer(); 84 refer = new SrsRefer();
85 bandwidth = new SrsBandwidth(); 85 bandwidth = new SrsBandwidth();
@@ -910,7 +910,7 @@ int SrsRtmpConn::check_edge_token_traverse_auth() @@ -910,7 +910,7 @@ int SrsRtmpConn::check_edge_token_traverse_auth()
910 } 910 }
911 911
912 srs_assert(stsock); 912 srs_assert(stsock);
913 - SrsSocket* io = new SrsSocket(stsock); 913 + SrsStSocket* io = new SrsStSocket(stsock);
914 SrsRtmpClient* client = new SrsRtmpClient(io); 914 SrsRtmpClient* client = new SrsRtmpClient(io);
915 915
916 ret = do_token_traverse_auth(io, client); 916 ret = do_token_traverse_auth(io, client);
@@ -956,7 +956,7 @@ int SrsRtmpConn::connect_server(int origin_index, st_netfd_t* pstsock) @@ -956,7 +956,7 @@ int SrsRtmpConn::connect_server(int origin_index, st_netfd_t* pstsock)
956 return ret; 956 return ret;
957 } 957 }
958 958
959 -int SrsRtmpConn::do_token_traverse_auth(SrsSocket* io, SrsRtmpClient* client) 959 +int SrsRtmpConn::do_token_traverse_auth(SrsStSocket* io, SrsRtmpClient* client)
960 { 960 {
961 int ret = ERROR_SUCCESS; 961 int ret = ERROR_SUCCESS;
962 962
@@ -41,7 +41,7 @@ class SrsSource; @@ -41,7 +41,7 @@ class SrsSource;
41 class SrsRefer; 41 class SrsRefer;
42 class SrsConsumer; 42 class SrsConsumer;
43 class SrsMessage; 43 class SrsMessage;
44 -class SrsSocket; 44 +class SrsStSocket;
45 #ifdef SRS_AUTO_HTTP_CALLBACK 45 #ifdef SRS_AUTO_HTTP_CALLBACK
46 class SrsHttpHooks; 46 class SrsHttpHooks;
47 #endif 47 #endif
@@ -58,7 +58,7 @@ class SrsRtmpConn : public virtual SrsConnection, public virtual ISrsReloadHandl @@ -58,7 +58,7 @@ class SrsRtmpConn : public virtual SrsConnection, public virtual ISrsReloadHandl
58 private: 58 private:
59 SrsRequest* req; 59 SrsRequest* req;
60 SrsResponse* res; 60 SrsResponse* res;
61 - SrsSocket* skt; 61 + SrsStSocket* skt;
62 SrsRtmpServer* rtmp; 62 SrsRtmpServer* rtmp;
63 SrsRefer* refer; 63 SrsRefer* refer;
64 SrsBandwidth* bandwidth; 64 SrsBandwidth* bandwidth;
@@ -95,7 +95,7 @@ private: @@ -95,7 +95,7 @@ private:
95 private: 95 private:
96 virtual int check_edge_token_traverse_auth(); 96 virtual int check_edge_token_traverse_auth();
97 virtual int connect_server(int origin_index, st_netfd_t* pstsock); 97 virtual int connect_server(int origin_index, st_netfd_t* pstsock);
98 - virtual int do_token_traverse_auth(SrsSocket* io, SrsRtmpClient* client); 98 + virtual int do_token_traverse_auth(SrsStSocket* io, SrsRtmpClient* client);
99 private: 99 private:
100 virtual int http_hooks_on_connect(); 100 virtual int http_hooks_on_connect();
101 virtual void http_hooks_on_close(); 101 virtual void http_hooks_on_close();
@@ -45,7 +45,7 @@ class SrsOnMetaDataPacket; @@ -45,7 +45,7 @@ class SrsOnMetaDataPacket;
45 class SrsSharedPtrMessage; 45 class SrsSharedPtrMessage;
46 class SrsForwarder; 46 class SrsForwarder;
47 class SrsRequest; 47 class SrsRequest;
48 -class SrsSocket; 48 +class SrsStSocket;
49 class SrsRtmpServer; 49 class SrsRtmpServer;
50 class SrsEdgeProxyContext; 50 class SrsEdgeProxyContext;
51 #ifdef SRS_AUTO_HLS 51 #ifdef SRS_AUTO_HLS
@@ -26,53 +26,53 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -26,53 +26,53 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 #include <srs_kernel_error.hpp> 26 #include <srs_kernel_error.hpp>
27 #include <srs_kernel_utility.hpp> 27 #include <srs_kernel_utility.hpp>
28 28
29 -SrsSocket::SrsSocket(st_netfd_t client_stfd) 29 +SrsStSocket::SrsStSocket(st_netfd_t client_stfd)
30 { 30 {
31 stfd = client_stfd; 31 stfd = client_stfd;
32 send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT; 32 send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT;
33 recv_bytes = send_bytes = 0; 33 recv_bytes = send_bytes = 0;
34 } 34 }
35 35
36 -SrsSocket::~SrsSocket() 36 +SrsStSocket::~SrsStSocket()
37 { 37 {
38 } 38 }
39 39
40 -bool SrsSocket::is_never_timeout(int64_t timeout_us) 40 +bool SrsStSocket::is_never_timeout(int64_t timeout_us)
41 { 41 {
42 return timeout_us == (int64_t)ST_UTIME_NO_TIMEOUT; 42 return timeout_us == (int64_t)ST_UTIME_NO_TIMEOUT;
43 } 43 }
44 44
45 -void SrsSocket::set_recv_timeout(int64_t timeout_us) 45 +void SrsStSocket::set_recv_timeout(int64_t timeout_us)
46 { 46 {
47 recv_timeout = timeout_us; 47 recv_timeout = timeout_us;
48 } 48 }
49 49
50 -int64_t SrsSocket::get_recv_timeout() 50 +int64_t SrsStSocket::get_recv_timeout()
51 { 51 {
52 return recv_timeout; 52 return recv_timeout;
53 } 53 }
54 54
55 -void SrsSocket::set_send_timeout(int64_t timeout_us) 55 +void SrsStSocket::set_send_timeout(int64_t timeout_us)
56 { 56 {
57 send_timeout = timeout_us; 57 send_timeout = timeout_us;
58 } 58 }
59 59
60 -int64_t SrsSocket::get_send_timeout() 60 +int64_t SrsStSocket::get_send_timeout()
61 { 61 {
62 return send_timeout; 62 return send_timeout;
63 } 63 }
64 64
65 -int64_t SrsSocket::get_recv_bytes() 65 +int64_t SrsStSocket::get_recv_bytes()
66 { 66 {
67 return recv_bytes; 67 return recv_bytes;
68 } 68 }
69 69
70 -int64_t SrsSocket::get_send_bytes() 70 +int64_t SrsStSocket::get_send_bytes()
71 { 71 {
72 return send_bytes; 72 return send_bytes;
73 } 73 }
74 74
75 -int SrsSocket::read(void* buf, size_t size, ssize_t* nread) 75 +int SrsStSocket::read(void* buf, size_t size, ssize_t* nread)
76 { 76 {
77 int ret = ERROR_SUCCESS; 77 int ret = ERROR_SUCCESS;
78 78
@@ -100,7 +100,7 @@ int SrsSocket::read(void* buf, size_t size, ssize_t* nread) @@ -100,7 +100,7 @@ int SrsSocket::read(void* buf, size_t size, ssize_t* nread)
100 return ret; 100 return ret;
101 } 101 }
102 102
103 -int SrsSocket::read_fully(void* buf, size_t size, ssize_t* nread) 103 +int SrsStSocket::read_fully(void* buf, size_t size, ssize_t* nread)
104 { 104 {
105 int ret = ERROR_SUCCESS; 105 int ret = ERROR_SUCCESS;
106 106
@@ -128,7 +128,7 @@ int SrsSocket::read_fully(void* buf, size_t size, ssize_t* nread) @@ -128,7 +128,7 @@ int SrsSocket::read_fully(void* buf, size_t size, ssize_t* nread)
128 return ret; 128 return ret;
129 } 129 }
130 130
131 -int SrsSocket::write(void* buf, size_t size, ssize_t* nwrite) 131 +int SrsStSocket::write(void* buf, size_t size, ssize_t* nwrite)
132 { 132 {
133 int ret = ERROR_SUCCESS; 133 int ret = ERROR_SUCCESS;
134 134
@@ -150,7 +150,7 @@ int SrsSocket::write(void* buf, size_t size, ssize_t* nwrite) @@ -150,7 +150,7 @@ int SrsSocket::write(void* buf, size_t size, ssize_t* nwrite)
150 return ret; 150 return ret;
151 } 151 }
152 152
153 -int SrsSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite) 153 +int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite)
154 { 154 {
155 int ret = ERROR_SUCCESS; 155 int ret = ERROR_SUCCESS;
156 156
@@ -37,7 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -37,7 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 * the socket provides TCP socket over st, 37 * the socket provides TCP socket over st,
38 * that is, the sync socket mechanism. 38 * that is, the sync socket mechanism.
39 */ 39 */
40 -class SrsSocket : public ISrsProtocolReaderWriter 40 +class SrsStSocket : public ISrsProtocolReaderWriter
41 { 41 {
42 private: 42 private:
43 int64_t recv_timeout; 43 int64_t recv_timeout;
@@ -46,8 +46,8 @@ private: @@ -46,8 +46,8 @@ private:
46 int64_t send_bytes; 46 int64_t send_bytes;
47 st_netfd_t stfd; 47 st_netfd_t stfd;
48 public: 48 public:
49 - SrsSocket(st_netfd_t client_stfd);  
50 - virtual ~SrsSocket(); 49 + SrsStSocket(st_netfd_t client_stfd);
  50 + virtual ~SrsStSocket();
51 public: 51 public:
52 virtual bool is_never_timeout(int64_t timeout_us); 52 virtual bool is_never_timeout(int64_t timeout_us);
53 virtual void set_recv_timeout(int64_t timeout_us); 53 virtual void set_recv_timeout(int64_t timeout_us);