MCPcopy Create free account
hub / github.com/3proxy/3proxy / readdata

Function readdata

src/smtpp.c:71–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71int 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 *)&param->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
97void * smtppchild(struct clientparam* param) {

Callers 1

smtppchildFunction · 0.85

Calls 6

myallocFunction · 0.85
sockgetlinebufFunction · 0.85
handledatfltcliFunction · 0.85
myfreeFunction · 0.85
socksendtoFunction · 0.85
socksendFunction · 0.85

Tested by

no test coverage detected