Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4def48b8
提交
4def48b8
authored
4月 24, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert
上级
2e0cd74e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
124 行增加
和
407 行删除
+124
-407
ws.c
src/mod/xml_int/mod_xml_rpc/ws.c
+103
-368
ws.h
src/mod/xml_int/mod_xml_rpc/ws.h
+21
-39
没有找到文件。
src/mod/xml_int/mod_xml_rpc/ws.c
浏览文件 @
4def48b8
差异被折叠。
点击展开。
src/mod/xml_int/mod_xml_rpc/ws.h
浏览文件 @
4def48b8
...
...
@@ -13,40 +13,30 @@
#include <sys/socket.h>
#else
#pragma warning(disable:4996)
#define snprintf _snprintf
#endif
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
//#include "sha1.h"
#include <openssl/ssl.h>
#include <../lib/abyss/src/session.h>
#include <../lib/abyss/src/conn.h>
#ifdef _MSC_VER
#define strncasecmp _strnicmp
#define snprintf _snprintf
#ifdef _WIN64
#define WS_SSIZE_T __int64
#elif _MSC_VER >= 1400
#define WS_SSIZE_T __int32 __w64
#else
#define WS_SSIZE_T __int32
#endif
typedef
WS_SSIZE_T
ssize_t
;
#endif
typedef
TSession
ws_tsession_t
;
typedef
int
issize_t
;
struct
ws_
globals_s
{
struct
globals_s
{
const
SSL_METHOD
*
ssl_method
;
SSL_CTX
*
ssl_ctx
;
char
cert
[
512
];
char
key
[
512
];
};
extern
struct
ws_globals_s
ws_
globals
;
// extern struct globals_s
globals;
typedef
int
ws_socket_t
;
#define ws_sock_invalid -1
...
...
@@ -69,44 +59,36 @@ typedef enum {
}
ws_opcode_t
;
typedef
struct
wsh_s
{
ws_
socket_t
sock
;
ws_
tsession_t
*
tsession
;
char
buffer
[
65536
];
char
wbuffer
[
65536
];
size_t
buflen
;
ssize_t
datalen
;
ssize_t
wdatalen
;
i
ssize_t
datalen
;
i
ssize_t
wdatalen
;
char
*
payload
;
ssize_t
plen
;
ssize_t
rplen
;
i
ssize_t
plen
;
i
ssize_t
rplen
;
SSL
*
ssl
;
int
handshake
;
uint8_t
down
;
int
secure
;
uint8_t
close_sock
;
SSL_CTX
*
ssl_ctx
;
int
block
;
int
sanity
;
int
secure_established
;
int
logical_established
;
int
x
;
}
wsh_t
;
ssize_t
ws_send_buf
(
wsh_t
*
wsh
,
ws_opcode_t
oc
);
ssize_t
ws_feed_buf
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
i
ssize_t
ws_send_buf
(
wsh_t
*
wsh
,
ws_opcode_t
oc
);
i
ssize_t
ws_feed_buf
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
ssize_t
ws_raw_read
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
ssize_t
ws_raw_write
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
ssize_t
ws_read_frame
(
wsh_t
*
wsh
,
ws_opcode_t
*
oc
,
uint8_t
**
data
);
ssize_t
ws_write_frame
(
wsh_t
*
wsh
,
ws_opcode_t
oc
,
void
*
data
,
size_t
bytes
);
int
ws_init
(
wsh_t
*
wsh
,
ws_socket_t
sock
,
SSL_CTX
*
ssl_ctx
,
int
close_sock
,
int
block
);
ssize_t
ws_close
(
wsh_t
*
wsh
,
int16_t
reason
);
i
ssize_t
ws_raw_read
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
i
ssize_t
ws_raw_write
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
i
ssize_t
ws_read_frame
(
wsh_t
*
wsh
,
ws_opcode_t
*
oc
,
uint8_t
**
data
);
i
ssize_t
ws_write_frame
(
wsh_t
*
wsh
,
ws_opcode_t
oc
,
void
*
data
,
size_t
bytes
);
wsh_t
*
ws_init
(
ws_tsession_t
*
tsession
);
i
ssize_t
ws_close
(
wsh_t
*
wsh
,
int16_t
reason
);
void
ws_destroy
(
wsh_t
*
wsh
);
void
init_ssl
(
void
);
void
deinit_ssl
(
void
);
int
xp_errno
(
void
);
int
xp_is_blocking
(
int
errcode
);
int
ws_handshake_kvp
(
wsh_t
*
wsh
,
char
*
key
,
char
*
version
,
char
*
proto
);
#ifndef _MSC_VER
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论