Subversion Repositories Tewi

Rev

Rev 395 | Rev 401 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 395 Rev 398
Line 1... Line 1...
1
/* $Id: server.c 395 2024-10-27 23:58:10Z nishi $ */
1
/* $Id: server.c 398 2024-10-28 00:11:59Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 342... Line 342...
342
	if(doc == NULL && f == NULL) return;
342
	if(doc == NULL && f == NULL) return;
343
	incr = 0;
343
	incr = 0;
344
	while(1) {
344
	while(1) {
345
		if(f != NULL) {
345
		if(f != NULL) {
346
			char buffer[512];
346
			char buffer[512];
-
 
347
			int st;
347
			fread(buffer, size < 512 ? size : 512, 1, f);
348
			fread(buffer, size < 512 ? size : 512, 1, f);
348
			if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) <= 0) return;
349
			if((st = tw_write(ssl, sock, buffer, size < 512 ? size : 512)) <= 0) break;
349
		} else {
350
		} else {
350
			if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) return;
351
			if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) break;
351
		}
352
		}
352
		incr += 512;
353
		incr += 512;
353
		if(size <= 512) break;
354
		if(size <= 512) break;
354
		size -= 512;
355
		size -= 512;
355
	}
356
	}