Revision f88f3c9d

View differences:

rep/repoclient.c
10 10
#if !WIN32 && !MAC_OS
11 11
	if ((publish_streambuffer.stream = open_memstream(&publish_streambuffer.buffer, &publish_streambuffer.len)) 
12 12
		== NULL) fatal("Unable to initilize repoclient, file %s, line %d", __FILE__, __LINE__);
13
#else
14
	publish_streambuffer.buffsize = PUBLISH_BUFFER_SIZE;
15
	publish_streambuffer.buffer = malloc(publish_streambuffer.buffsize);
16
        if(publish_streambuffer.buffer == NULL) {
17
		publish_streambuffer.buffsize = 0;
18
		fatal("Unable to initilize repoclient, file %s, line %d", __FILE__, __LINE__);
19
	}
13 20
#endif
14
	debug("The Repository client library is ready");
21
	else debug("The Repository client library is ready");
15 22
}
16 23

  
17 24
/** Initialize the repoclient instance by parsing the server spec string and setting up things */
18 25
HANDLE repOpen(const char *server, int publish_delay) { 
19
	struct reposerver *rep = malloc(sizeof(struct reposerver));
26
	struct reposerver *rep;
27

  
28
        if(server == NULL || strlen(server) == 0 || strcmp(server, "-") == 0) {
29
                warn("Repository publishing is disabled");
30
		return NULL;
31
	}
32

  
33
	rep = malloc(sizeof(struct reposerver));
20 34
	if (!rep) fatal("Out of memory while initializing repository client for %s", server);
21 35
	rep->magic=REPOSERVER_MAGIC;
22 36
	rep->publish_buffer = NULL;
rep/repoclient_impl.h
27 27

  
28 28
#define REPOSERVER_MAGIC        0xAABB
29 29
#define PUBLISH_BUFFER_SIZE	1024
30
#define SB_INCREMENT 		512
30 31

  
31 32
/** Struct maintaining streambuffer data. Used internally */
32 33
struct streambuffer {
33 34
#ifndef WINNT
34 35
	FILE *stream;
36
#else
37
	size_t buffsize;
35 38
#endif
36 39
	char *buffer;
37 40
	size_t len;
rep/utils.c
6 6
        struct reposerver *r = (struct reposerver *)h;
7 7

  
8 8
	if (!r) {
9
		error("Trying to use a NULL reposerver handle in fn %s", fn);
9
		debug("Using a NULL reposerver handle in fn %s", fn);
10 10
		return 0;
11 11
	}
12 12
	if (r->magic != REPOSERVER_MAGIC) {

Also available in: Unified diff