343 |
|
incr = 0; |
344 |
|
while(1) { |
345 |
|
if(f != NULL) { |
346 |
< |
char buffer[128]; |
347 |
< |
fread(buffer, size < 128 ? size : 128, 1, f); |
348 |
< |
tw_write(ssl, sock, buffer, size < 128 ? size : 128); |
346 |
> |
char buffer[512]; |
347 |
> |
int st; |
348 |
> |
fread(buffer, size < 512 ? size : 512, 1, f); |
349 |
> |
if((st = tw_write(ssl, sock, buffer, size < 512 ? size : 512)) <= 0) break; |
350 |
|
} else { |
351 |
< |
tw_write(ssl, sock, (unsigned char*)doc + incr, size < 128 ? size : 128); |
351 |
> |
if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) break; |
352 |
|
} |
353 |
< |
incr += 128; |
354 |
< |
if(size <= 128) break; |
355 |
< |
size -= 128; |
353 |
> |
incr += 512; |
354 |
> |
if(size <= 512) break; |
355 |
> |
size -= 512; |
356 |
|
} |
357 |
|
} |
358 |
|
|
641 |
|
host[i] = 0; |
642 |
|
port = atoi(host + i + 1); |
643 |
|
break; |
644 |
+ |
}else if(vhost[i] == '['){ |
645 |
+ |
for(; vhost[i] != 0 && vhost[i] != ']'; i++); |
646 |
|
} |
647 |
|
} |
648 |
|
name = host; |
1023 |
|
struct timeval tv; |
1024 |
|
#endif |
1025 |
|
#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__) && !defined(__DOS__)) |
1026 |
< |
struct thread_entry threads[2048]; |
1026 |
> |
struct thread_entry threads[128]; |
1027 |
|
for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { |
1028 |
|
threads[i].used = false; |
1029 |
|
} |