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 |
> |
fread(buffer, size < 512 ? size : 512, 1, f); |
348 |
> |
if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) <= 0) return; |
349 |
|
} else { |
350 |
< |
tw_write(ssl, sock, (unsigned char*)doc + incr, size < 128 ? size : 128); |
350 |
> |
if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) return; |
351 |
|
} |
352 |
< |
incr += 128; |
353 |
< |
if(size <= 128) break; |
354 |
< |
size -= 128; |
352 |
> |
incr += 512; |
353 |
> |
if(size <= 512) break; |
354 |
> |
size -= 512; |
355 |
|
} |
356 |
|
} |
357 |
|
|
620 |
|
time_t t; |
621 |
|
struct tm* btm; |
622 |
|
strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm); |
623 |
< |
#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) |
623 |
> |
#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) || defined(__bsdi__) |
624 |
|
t = 0; |
625 |
|
btm = localtime(&t); |
626 |
|
cmtime = mktime(&tm); |
640 |
|
host[i] = 0; |
641 |
|
port = atoi(host + i + 1); |
642 |
|
break; |
643 |
+ |
}else if(vhost[i] == '['){ |
644 |
+ |
for(; vhost[i] != 0 && vhost[i] != ']'; i++); |
645 |
|
} |
646 |
|
} |
647 |
|
name = host; |
793 |
|
addstring(&str, " <tr>\n"); |
794 |
|
addstring(&str, " <th></th>\n"); |
795 |
|
addstring(&str, " <th>Filename</th>\n"); |
796 |
+ |
addstring(&str, " <th>Last-modified</th>\n"); |
797 |
|
addstring(&str, " <th>MIME</th>\n"); |
798 |
|
addstring(&str, " <th>Size</th>\n"); |
799 |
|
addstring(&str, " </tr>\n"); |
811 |
|
char* fpth = cm_strcat3(path, "/", items[i]); |
812 |
|
struct stat s; |
813 |
|
char size[512]; |
814 |
+ |
char date[512]; |
815 |
|
char* showmime; |
816 |
|
char* mime; |
817 |
+ |
struct tm* tm; |
818 |
|
size[0] = 0; |
819 |
|
stat(fpth, &s); |
820 |
+ |
tm = localtime(&s.st_mtime); |
821 |
+ |
strftime(date, 512, "%a, %d %b %Y %H:%M:%S %Z", tm); |
822 |
|
if(phase == 0 && !S_ISDIR(s.st_mode)) { |
823 |
|
free(fpth); |
824 |
|
continue; |
892 |
|
addstring(&str, "<tr>\n"); |
893 |
|
addstring(&str, " <td><img src=\"%s\" alt=\"icon\"></td>\n", icon); |
894 |
|
addstring(&str, " <td><a href=\"%l\"><code>%h</code></a></td>\n", items[i], itm); |
895 |
+ |
addstring(&str, " <td><code> %h </code></td>\n", date); |
896 |
|
addstring(&str, " <td><code> %h </code></td>\n", showmime); |
897 |
|
addstring(&str, " <td><code> %s </code></td>\n", size); |
898 |
|
addstring(&str, "</tr>\n"); |
1021 |
|
fd_set fdset; |
1022 |
|
struct timeval tv; |
1023 |
|
#endif |
1024 |
< |
#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__)) |
1024 |
> |
#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__) && !defined(__DOS__)) |
1025 |
|
struct thread_entry threads[2048]; |
1026 |
|
for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { |
1027 |
|
threads[i].used = false; |