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

Function readreply

src/smtpp.c:18–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 "250 DSN\r\n";
17
18int readreply (struct clientparam* param) {
19 unsigned char * buf;
20 int res, i, bufsize = 640;
21
22 if(!(buf = myalloc(bufsize))) return 0;
23 do {
24 i = sockgetlinebuf(param, SERVER, buf, bufsize-1, '\n', conf.timeouts[STRING_L]);
25 if(i < 1) break;
26#ifndef WITHMAIN
27 res = handlehdrfilterssrv(param, &buf, &bufsize, 0, &i);
28 if(res != PASS) {
29 myfree(buf);
30 return -1;
31 }
32#endif
33 socksend(param->clisock, buf, i, conf.timeouts[STRING_S]);
34 } while (i > 3 && buf[3] == '-');
35 if(i < 3) {
36 myfree(buf);
37 return 0;
38 }
39 buf[i] = 0;
40 res = atoi((char *)buf);
41 myfree(buf);
42 return res;
43}
44
45int readcommand (struct clientparam* param) {
46 unsigned char * buf;

Callers 1

smtppchildFunction · 0.85

Calls 5

myallocFunction · 0.85
sockgetlinebufFunction · 0.85
handlehdrfilterssrvFunction · 0.85
myfreeFunction · 0.85
socksendFunction · 0.85

Tested by

no test coverage detected