Revision f88f3c9d rep/repoclient.c

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;

Also available in: Unified diff