MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / FtpWrite

Function FtpWrite

src/filer/ftplib/ftplib.cpp:918–939  ·  view source on GitHub ↗

* FtpWrite - write to a data connection */

Source from the content-addressed store, hash-verified

916 * FtpWrite - write to a data connection
917 */
918GLOBALDEF int FtpWrite(const void *buf, int len, netbuf *nData) {
919 int i;
920 if (nData->dir != FTPLIB_WRITE)
921 return 0;
922 if (nData->buf)
923 i = writeline((char *) buf, len, nData);
924 else {
925 socket_wait(nData);
926 i = net_write(nData->handle, (char *) buf, len);
927 }
928 if (i == -1)
929 return 0;
930 nData->xfered += i;
931 if (nData->idlecb && nData->cbbytes) {
932 nData->xfered1 += i;
933 if (nData->xfered1 > nData->cbbytes) {
934 nData->idlecb(nData, nData->xfered, nData->idlearg);
935 nData->xfered1 = 0;
936 }
937 }
938 return i;
939}
940
941/*
942 * FtpClose - close a data connection

Callers 1

FtpXferFunction · 0.85

Calls 3

writelineFunction · 0.85
socket_waitFunction · 0.85
net_writeFunction · 0.85

Tested by

no test coverage detected