This commit is contained in:
lxsang 2019-11-30 19:40:40 +00:00
parent f48321e1a1
commit 5d795ce4c3
4 changed files with 7 additions and 6 deletions

Binary file not shown.

View File

@ -483,10 +483,10 @@ void *serve_file(void *data)
char *path = (char *)dvalue(rq->request, "ABS_RESOURCE_PATH"); char *path = (char *)dvalue(rq->request, "ABS_RESOURCE_PATH");
char *mime_type = (char *)dvalue(rq->request, "RESOURCE_MIME"); char *mime_type = (char *)dvalue(rq->request, "RESOURCE_MIME");
ctype(rq->client, mime_type); ctype(rq->client, mime_type);
if (is_bin(path)) /*if (is_bin(path))
__fb(rq->client, path); __fb(rq->client, path);
else else*/
__f(rq->client, path); __f(rq->client, path);
return task; return task;
} }

View File

@ -477,7 +477,7 @@ int __b(void* client, const unsigned char* data, int size)
} }
return 1; return 1;
} }
int __fb(void* client, const char* file) int __f(void* client, const char* file)
{ {
printf("Open file %s\n",file ); printf("Open file %s\n",file );
unsigned char buffer[BUFFLEN]; unsigned char buffer[BUFFLEN];
@ -497,6 +497,7 @@ int __fb(void* client, const char* file)
fclose(ptr); fclose(ptr);
return 1; return 1;
} }
/*
int __f(void* client, const char* file) int __f(void* client, const char* file)
{ {
char buf[BUFFLEN]; char buf[BUFFLEN];
@ -520,7 +521,7 @@ int __f(void* client, const char* file)
fclose(ptr); fclose(ptr);
return 1; return 1;
} }
*/
int upload(const char* tmp, const char* path) int upload(const char* tmp, const char* path)
{ {
return !rename(tmp, path); return !rename(tmp, path);

View File

@ -95,7 +95,7 @@ int __ti(void*,int);
int __t(void*, const char*,...); int __t(void*, const char*,...);
int __b(void*, const unsigned char*, int); int __b(void*, const unsigned char*, int);
int __f(void*, const char*); int __f(void*, const char*);
int __fb(void*, const char*); //int __fb(void*, const char*);
int upload(const char*, const char*); int upload(const char*, const char*);
void set_cookie(void*, const char*,dictionary,const char*); void set_cookie(void*, const char*,dictionary,const char*);