cur = reply->elements;
while (cur) {
elt = cur->data;
- memcpy (&ina, elt->a.addr, sizeof (in_addr_t));
+ memcpy (&ina, &elt->a.addr[0], sizeof (struct in_addr));
/* Actually this copy memory, so using of inet_ntoa is valid */
lua_pushstring (cd->L, inet_ntoa (ina));
lua_rawseti (cd->L, -2, ++i);
}
lua_pushnil (cd->L);
}
- else if (reply->type == DNS_REQUEST_A) {
+ else if (reply->type == DNS_REQUEST_PTR) {
lua_newtable (cd->L);
cur = reply->elements;
while (cur) {
lua_task_get_recipients_headers (lua_State *L)
{
struct worker_task *task = lua_check_task (L);
- InternetAddressList *addrs;
if (task) {
- addrs = g_mime_message_get_all_recipients(task->message);
- lua_push_internet_address (L, addrs);
-#ifndef GMIME24
- internet_address_list_destroy (addrs);
-#else
- g_object_unref (addrs);
-#endif
+ lua_push_internet_address (L, task->rcpts);
return 1;
}
}
else {
mem_pool_stat->oversized_chunks++;
- new = pool_chain_new (size + cur->len);
+ new = pool_chain_new (size + pool->first_pool->len);
}
/* Attach new pool to chain */
cur->next = new;
{
void *pointer = memory_pool_alloc (pool, size);
if (pointer) {
- bzero (pointer, size);
+ memset (pointer, 0, size);
}
return pointer;
}
{
void *pointer = memory_pool_alloc_shared (pool, size);
if (pointer) {
- bzero (pointer, size);
+ memset (pointer, 0, size);
}
return pointer;
}
cur = memory_pool_alloc (pool, sizeof (struct _pool_destructors));
if (cur) {
- /* Check whether we have identical destructor in pool */
- tmp = pool->destructors;
- while (tmp) {
- if (tmp->func == func && tmp->data == data) {
- /* Do not add identical destructors, they must be unique */
- msg_warn ("duplicate desctrutors detected: already have destructor from %s:%s and is trying to add from %s:%s",
- tmp->function, tmp->loc, function, line);
- return;
- }
- tmp = tmp->prev;
- }
-
cur->func = func;
cur->data = data;
cur->function = function;