mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
修复内存失效的问题
This commit is contained in:
@@ -8,21 +8,24 @@
|
||||
* may be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "string.h"
|
||||
#include "mk_tcp.h"
|
||||
#include "mk_tcp_private.h"
|
||||
#include "Http/WebSocketClient.h"
|
||||
#include "Http/WebSocketSession.h"
|
||||
using namespace mediakit;
|
||||
|
||||
API_EXPORT const char* API_CALL mk_sock_info_peer_ip(const mk_sock_info ctx){
|
||||
API_EXPORT const char* API_CALL mk_sock_info_peer_ip(const mk_sock_info ctx, char *buf){
|
||||
assert(ctx);
|
||||
SockInfo *sock = (SockInfo *)ctx;
|
||||
return sock->get_peer_ip().c_str();
|
||||
strcpy(buf,sock->get_peer_ip().c_str());
|
||||
return buf;
|
||||
}
|
||||
API_EXPORT const char* API_CALL mk_sock_info_local_ip(const mk_sock_info ctx){
|
||||
API_EXPORT const char* API_CALL mk_sock_info_local_ip(const mk_sock_info ctx, char *buf){
|
||||
assert(ctx);
|
||||
SockInfo *sock = (SockInfo *)ctx;
|
||||
return sock->get_local_ip().c_str();
|
||||
strcpy(buf,sock->get_peer_ip().c_str());
|
||||
return buf;
|
||||
}
|
||||
API_EXPORT uint16_t API_CALL mk_sock_info_peer_port(const mk_sock_info ctx){
|
||||
assert(ctx);
|
||||
|
||||
Reference in New Issue
Block a user