mirror of
https://github.com/fumiama/simple-kanban.git
synced 2026-06-29 23:51:09 +08:00
try to fix upload
This commit is contained in:
6
server.c
6
server.c
@@ -616,10 +616,14 @@ static int s3_set_data(threadtimer_t *timer) {
|
|||||||
while(remain > 0) {
|
while(remain > 0) {
|
||||||
// printf("remain:%d\n", (int)remain);
|
// printf("remain:%d\n", (int)remain);
|
||||||
ssize_t n = recv(timer->accept_fd, timer->data, (remain>TIMERDATSZ)?TIMERDATSZ:remain, MSG_WAITALL);
|
ssize_t n = recv(timer->accept_fd, timer->data, (remain>TIMERDATSZ)?TIMERDATSZ:remain, MSG_WAITALL);
|
||||||
if(n <= 0) {
|
if(n < 0) {
|
||||||
*(uint32_t*)ret = *(uint32_t*)"erro";
|
*(uint32_t*)ret = *(uint32_t*)"erro";
|
||||||
goto S3_RETURN;
|
goto S3_RETURN;
|
||||||
}
|
}
|
||||||
|
else if(!n) {
|
||||||
|
usleep(10000); // 10 ms
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(fwrite(timer->data, n, 1, timer->fp) != 1) {
|
if(fwrite(timer->data, n, 1, timer->fp) != 1) {
|
||||||
perror("fwrite");
|
perror("fwrite");
|
||||||
*(uint32_t*)ret = *(uint32_t*)"erro";
|
*(uint32_t*)ret = *(uint32_t*)"erro";
|
||||||
|
|||||||
Reference in New Issue
Block a user