Yeah shure, but the thing is that it's not even executing the printf()
Code:
void newfile(int *sock) {
printf("New file created");
char buff[512];
char filepath[128];
long int totalparts;
char *p;
int i, len;
i = *sock;
len = recv(*sock, buff, sizeof(buff), 0);
printf("Recieved of path: %i", len);
strcat(buff, "\0");
p=strtok(buff, "=");
p=strtok(NULL, ";");
strcpy(filepath, p);
p=strtok(NULL, "=");
p=strtok(NULL, ";");
totalparts=strtol(p,NULL,10);
if((memfiles[i].file=fopen(filepath, "ab"))) {
memfiles[i].exists=1;
memfiles[i].parts=0;
memfiles[i].totalparts=totalparts;
}
else {
printf("Error on creating new file");
}
}
Printed things
Code:
Server Change
Socket Creado
Port 3000 bindeado
Socket Listeneando
Select starteado
Nueva conexion.. testeando pass
Client Passwd: lol and lenght: 3
Server Passwd: lol and lenght: 3
Que da el cmp: 0
Password correcta
newfd = 4 y fdmax = 3
Alocando memfiles
Total Connected = 1
Alocado memfiles
Seteando memfiles en socket 3
Select starteado
Existant connection incomming from set = 4
Recieving new file from = 4
Fallo de segmentación
Mmm.. do you know any library that has a getpixel() function like the windows one?