107 |
|
#endif |
108 |
|
#endif |
109 |
|
|
110 |
< |
#if defined(_PSP) || defined(__ps2sdk__) |
110 |
> |
#if defined(_PSP) || defined(__ps2sdk__) || defined(__bsdi__) |
111 |
|
#include "strptime.h" |
112 |
|
#endif |
113 |
|
|
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 |
|
|
621 |
|
time_t t; |
622 |
|
struct tm* btm; |
623 |
|
strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm); |
624 |
< |
#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) |
624 |
> |
#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) || defined(__bsdi__) |
625 |
|
t = 0; |
626 |
|
btm = localtime(&t); |
627 |
|
cmtime = mktime(&tm); |
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; |
794 |
|
addstring(&str, " <tr>\n"); |
795 |
|
addstring(&str, " <th></th>\n"); |
796 |
|
addstring(&str, " <th>Filename</th>\n"); |
797 |
+ |
addstring(&str, " <th>Last-modified</th>\n"); |
798 |
|
addstring(&str, " <th>MIME</th>\n"); |
799 |
|
addstring(&str, " <th>Size</th>\n"); |
800 |
|
addstring(&str, " </tr>\n"); |
812 |
|
char* fpth = cm_strcat3(path, "/", items[i]); |
813 |
|
struct stat s; |
814 |
|
char size[512]; |
815 |
+ |
char date[512]; |
816 |
|
char* showmime; |
817 |
|
char* mime; |
818 |
+ |
struct tm* tm; |
819 |
|
size[0] = 0; |
820 |
|
stat(fpth, &s); |
821 |
+ |
tm = localtime(&s.st_mtime); |
822 |
+ |
strftime(date, 512, "%a, %d %b %Y %H:%M:%S %Z", tm); |
823 |
|
if(phase == 0 && !S_ISDIR(s.st_mode)) { |
824 |
|
free(fpth); |
825 |
|
continue; |
893 |
|
addstring(&str, "<tr>\n"); |
894 |
|
addstring(&str, " <td><img src=\"%s\" alt=\"icon\"></td>\n", icon); |
895 |
|
addstring(&str, " <td><a href=\"%l\"><code>%h</code></a></td>\n", items[i], itm); |
896 |
+ |
addstring(&str, " <td><code> %h </code></td>\n", date); |
897 |
|
addstring(&str, " <td><code> %h </code></td>\n", showmime); |
898 |
|
addstring(&str, " <td><code> %s </code></td>\n", size); |
899 |
|
addstring(&str, "</tr>\n"); |
1022 |
|
fd_set fdset; |
1023 |
|
struct timeval tv; |
1024 |
|
#endif |
1025 |
< |
#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__)) |
1026 |
< |
struct thread_entry threads[2048]; |
1025 |
> |
#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__) && !defined(__DOS__)) |
1026 |
> |
struct thread_entry threads[128]; |
1027 |
|
for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { |
1028 |
|
threads[i].used = false; |
1029 |
|
} |