| 43 | } |
| 44 | |
| 45 | int readcommand (struct clientparam* param) { |
| 46 | unsigned char * buf; |
| 47 | int res, i, bufsize = 320; |
| 48 | int ret = 1; |
| 49 | |
| 50 | if(!(buf = myalloc(bufsize))) return 0; |
| 51 | i = sockgetlinebuf(param, CLIENT, buf, bufsize-1, '\n', conf.timeouts[STRING_L]); |
| 52 | if(i < 4) return 0; |
| 53 | #ifndef WITHMAIN |
| 54 | if(!strncasecmp((char *)buf, "MAIL", 4) || !strncasecmp((char *)buf, "RCPT", 4) || !strncasecmp((char *)buf, "STARTTLS", 8) || !strncasecmp((char *)buf, "TURN", 4)){ |
| 55 | res = handlehdrfilterscli(param, &buf, &bufsize, 0, &i); |
| 56 | if(res != PASS) { |
| 57 | myfree(buf); |
| 58 | if(res == HANDLED) return 2; |
| 59 | return -1; |
| 60 | } |
| 61 | } |
| 62 | #endif |
| 63 | socksend(param->remsock, buf, i, conf.timeouts[STRING_S]); |
| 64 | myfree(buf); |
| 65 | if(!strncasecmp((char *)buf, "STARTTLS", 8) || !strncasecmp((char *)buf, "TURN", 4)){ |
| 66 | ret = 22; |
| 67 | } |
| 68 | return ret; |
| 69 | } |
| 70 | |
| 71 | int readdata (struct clientparam* param) { |
| 72 | unsigned char * buf; |
no test coverage detected