goahead 单步跟踪分析

goahead 单步跟踪分析

1.

static char websHost[ME_MAX_IP]; /* Host name for the server */

static char websIpAddr[ME_MAX_IP]; /* IP address for the server */

http.c 静态static 限制局部变量当前文件有效....

2.mbedtls_ssl_config

物联网的嵌入式设备适合小巧灵活的MbedTLS

安全传输层协议(TLS)用于在两个通信应用程序之间提供保密性和数据完整性。该协议由两层组成: TLS 记录协议(TLS Record)和 TLS 握手协议(TLS Handshake)。

3.walloc内存分配(malloc)

typedef void (*WebsMemNotifier)(ssize size);
static WebsMemNotifier memNotifier;

PUBLIC void *walloc(ssize num)
{
void *mem;

if ((mem = malloc(num)) == 0) {
if (memNotifier) {
(memNotifier)(num);
}
}
return mem;
}


PUBLIC void wfree(void *mem)
{
if (mem) {
free(mem);
}
}

4.webbuf、websocket

typedef struct WebsSocket {
WebsBuf lineBuf; /**< Line ring queue */
SocketAccept accept; /**< Accept handler */
SocketHandler handler; /**< User I/O handler */
char *ip; /**< Server listen address or remote client address */
void *handler_data; /**< User handler data */
int handlerMask; /**< Handler events of interest */
int sid; /**< Index into socket[] */
int port; /**< Port to listen on */
int flags; /**< Current state flags */
Socket sock; /**< Actual socket handle */
int fileHandle; /**< ID of the file handler */
int interestEvents; /**< Mask of events to watch for */
int currentEvents; /**< Mask of ready events (FD_xx) */
int selectEvents; /**< Events being selected */
int saveMask; /**< saved Mask for socketFlush */
int error; /**< Last error */
int secure; /**< Socket is using SSL */
int handshakes; /**< Number of renegotiations */
} WebsSocket;

posted on 2022-09-25 08:30  lydstory  阅读(63)  评论(0)    收藏  举报

导航