File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 36
36
#include "zmalloc.h"
37
37
#include "request.h"
38
38
39
-
39
+ /* useful symbols:
40
+ * '*' and '$' states are:3
41
+ * '0' '1' '2' '3' '4' '5' '6' '7' '8' '9';states are 2
42
+ */
40
43
//==============================DFA states=================================//
41
44
unsigned char _table [256 ]= {
42
45
/* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */
@@ -112,7 +115,7 @@ int req_state_len(struct request *req,char *sb)
112
115
return STATE_FAIL ;
113
116
default :
114
117
if (first == 1 ){
115
- /* the first symbol is not '*'*/
118
+ /* the first symbol is not '*' or '$' */
116
119
if (_table [(unsigned char )c ]!= 3 )
117
120
return STATE_FAIL ;
118
121
}else {
@@ -152,7 +155,7 @@ int request_parse(struct request *req)
152
155
/*parse argv len*/
153
156
memset (sb ,0 ,BUF_SIZE );
154
157
if (req_state_len (req ,sb )!= STATE_CONTINUE ){
155
- fprintf (stderr ,"argv_len format ***ERROR***,packet:%s" ,sb );
158
+ fprintf (stderr ,"argv's length format ***ERROR***,packet:%s" ,sb );
156
159
return 0 ;
157
160
}
158
161
argv_len = atoi (sb );
You can’t perform that action at this time.
0 commit comments