server.c dodanie miejsca na ftp

This commit is contained in:
s449273 2019-11-29 15:42:35 +01:00
parent 7c4c081c9a
commit 81a23a3a49

View File

@ -110,12 +110,36 @@ int main(int argc, char **argv)
{
printf("Server shut down..\n");
close(sdconnection);
close(sdsocket);
return 0;
}
else if (strncmp("FTP", odbior, 3) == 0)
{
bzero(name_file, 512);
strncpy (name_file, odbior+4, 509);
printf("Plik do wyslania :%s\n", name_file);
while ((sdconnection2 =
accept(sdsocket,
(struct sockaddr *)&endpoint,
&addrlen)) >= 0)
{
send(sdconnection2, name_file, 512, 0);
close(sdconnection2);
break;
}
}
else
{