]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bnet.c
Use the command line utility dropdb instead of the psql command
[bacula/bacula] / bacula / src / lib / bnet.c
index be35ef7d5df0bb66d4b89ffe4f021ae140c778da..69039eda49ffaf333ddaaa6624c4f31540e08673 100644 (file)
@@ -284,7 +284,7 @@ int bnet_despool(BSOCK *bsock)
       bsock->msglen = ntohl(pktsiz);
       if (bsock->msglen > 0) {
         if (bsock->msglen > (int32_t)sizeof_pool_memory(bsock->msg)) {
-           bsock->msg = realloc_pool_memory(bsock->msg, bsock->msglen);
+           bsock->msg = realloc_pool_memory(bsock->msg, bsock->msglen + 1);
         }
         nbytes = fread(bsock->msg, 1, bsock->msglen, bsock->spool_fd);
         if (nbytes != (size_t)bsock->msglen) {
@@ -540,7 +540,7 @@ static uint32_t *bget_host_ip(JCR *jcr, char *host)
    } else {
       P(ip_mutex);
       if ((hp = gethostbyname(host)) == NULL) {
-         Jmsg2(jcr, M_ERROR, 0, "gethostbyname() for %s failed: ERR=%s\n", 
+         Jmsg2(jcr, M_ERROR, 0, "gethostbyname() for host \"%s\" failed: ERR=%s\n", 
               host, gethost_strerror());
         V(ip_mutex);
         return NULL;
@@ -697,7 +697,7 @@ again:
    bs->msglen = bvsnprintf(mp_chr(bs->msg), maxlen, fmt, arg_ptr);
    va_end(arg_ptr);
    if (bs->msglen < 0 || bs->msglen >= maxlen) {
-      bs->msg = realloc_pool_memory(bs->msg, maxlen + 200);
+      bs->msg = realloc_pool_memory(bs->msg, maxlen + maxlen / 2);
       goto again;
    }
    return bnet_send(bs);