| 69 | } |
| 70 | |
| 71 | int readdata (struct clientparam* param) { |
| 72 | unsigned char * buf; |
| 73 | int res, i, bufsize = 4096; |
| 74 | |
| 75 | if(!(buf = myalloc(bufsize))) return 0; |
| 76 | while ((i = sockgetlinebuf(param, CLIENT, buf, bufsize-1, '\n', conf.timeouts[STRING_L])) > 0 && !(i==3 && buf[0] == '.')){ |
| 77 | #ifndef WITHMAIN |
| 78 | res = handledatfltcli(param, &buf, &bufsize, 0, &i); |
| 79 | if(res != PASS) { |
| 80 | myfree(buf); |
| 81 | if(res == HANDLED) return 1; |
| 82 | return -1; |
| 83 | } |
| 84 | #endif |
| 85 | socksendto(param->remsock, (struct sockaddr *)¶m->sinsr, buf, i, conf.timeouts[STRING_S]); |
| 86 | } |
| 87 | if(i < 1) { |
| 88 | myfree(buf); |
| 89 | return 0; |
| 90 | } |
| 91 | socksend(param->remsock, buf, i, conf.timeouts[STRING_S]); |
| 92 | myfree(buf); |
| 93 | return 1; |
| 94 | } |
| 95 | |
| 96 | |
| 97 | void * smtppchild(struct clientparam* param) { |
no test coverage detected