if(f != NULL) {
char buffer[512];
fread(buffer, size < 512 ? size : 512, 1, f);
- tw_write(ssl, sock, buffer, size < 512 ? size : 512);
+ if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) < 0) return;
} else {
- tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512);
+ if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) < 0) return;
}
incr += 512;
if(size <= 512) break;