提交 c3d765ad 编写于 作者: L liu0x54

[TD-154] ban authentication based on failure count

上级 44eb12c1
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h>
#include "tsdb.h" #include "tsdb.h"
#include "ttime.h" #include "ttime.h"
...@@ -158,6 +159,19 @@ int32_t taosParseTime(char* timestr, int64_t* time, int32_t len, int32_t timePre ...@@ -158,6 +159,19 @@ int32_t taosParseTime(char* timestr, int64_t* time, int32_t len, int32_t timePre
} }
} }
int32_t taosTimeSecToString(time_t ts,char* outstr) {
if (NULL == outstr) {
return 1;
}
struct tm *t;
t = localtime(&ts);
if (NULL == t) return 1;
sprintf(outstr,"%4d-%02d-%02d %02d:%02d:%02d\n", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
return 0;
}
char* forwardToTimeStringEnd(char* str) { char* forwardToTimeStringEnd(char* str) {
int32_t i = 0; int32_t i = 0;
int32_t numOfSep = 0; int32_t numOfSep = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册