Exemple #1
0
 * starts proxy thread.
 **/
static ZProxy *
finger_proxy_new(ZProxyParams *params)
{
    FingerProxy  *self;

    z_enter();
    self = Z_CAST(z_proxy_new(Z_CLASS(FingerProxy), params), FingerProxy);
    z_return((ZProxy *) self);
}

ZProxyFuncs finger_proxy_funcs =
{
    {
        Z_FUNCS_COUNT(ZProxy),
        NULL
    },
    .config = finger_config,
    .main = finger_main,
    NULL
};

Z_CLASS_DEF(FingerProxy, ZProxy, finger_proxy_funcs);

/*+

  Module initialization function. Registers a new proxy type.

  +*/
gint
Exemple #2
0
                }
            }
          else
            {
              g_string_append(self->actual_header, "\r\n");
              g_string_append_len(self->actual_header, buf, bytes_need);
            }
        }
    }
  return ret;
}

ZTransfer2Funcs pop3_transfer_funcs =
{
  {
    Z_FUNCS_COUNT(ZTransfer2),
    NULL,
  },
  .src_read = pop3_transfer_src_read,
  .dst_write = NULL,
  .src_shutdown = NULL,
  .dst_shutdown = NULL,
  .stack_proxy = pop3_transfer_stack,
  .setup = NULL, /* setup */
  .run = NULL,
  .progress = NULL  /* progress */
};

Z_CLASS_DEF(Pop3Transfer, ZDotTransfer, pop3_transfer_funcs);

gboolean
Exemple #3
0
void
z_certificate_chain_add_cert_to_chain(ZCertificateChain *self, X509 *cert)
{
  sk_X509_push(self->chain, cert);
  CRYPTO_add(&cert->references, 1, CRYPTO_LOCK_X509);
}

X509 *
z_certificate_chain_get_cert_from_chain(ZCertificateChain *self, gint idx)
{
  return sk_X509_value(self->chain, idx);
}

static void
z_certificate_chain_free_method(ZObject *s)
{
  ZCertificateChain *self = Z_CAST(s, ZCertificateChain);
  if (self->cert)
    X509_free(self->cert);
  sk_X509_pop_free(self->chain, X509_free);
  z_object_free_method(s);
}

ZObjectFuncs z_certificate_chain_funcs =
{
  Z_FUNCS_COUNT(ZObject),
  z_certificate_chain_free_method,
};

Z_CLASS_DEF(ZCertificateChain, ZObject, z_certificate_chain_funcs);
Exemple #4
0
  return &self->super;
}

void
z_proxy_ssl_host_iface_free_method(ZObject *s)
{
  ZProxySslHostIface *self = Z_CAST(s, ZProxySslHostIface);

  X509_free(self->server_cert);
  z_object_free_method(s);
}

ZProxyHostIfaceFuncs z_proxy_ssl_host_iface_funcs =
{
  {
    Z_FUNCS_COUNT(ZProxyHostIface),
    z_proxy_ssl_host_iface_free_method,
  },
  .check_name = z_proxy_ssl_host_iface_check_name_method,
};

ZClass ZProxySslHostIface__class =
{
  Z_CLASS_HEADER,
  Z_CLASS(ZProxyHostIface),
  "ZProxySslHostIface",
  sizeof(ZProxySslHostIface),
  &z_proxy_ssl_host_iface_funcs.super,
};

Exemple #5
0
  self = Z_CAST(z_proxy_stack_iface_new(Z_CLASS(ZTransfer2PSIface), transfer->owner), ZTransfer2PSIface);
  self->transfer = transfer;
  return &self->super;
}

static void
z_transfer2_ps_iface_free(ZObject *s)
{
  z_proxy_stack_iface_free_method(s);
}

ZProxyStackIfaceFuncs z_transfer2_ps_iface_funcs =
{
  {
    Z_FUNCS_COUNT(ZProxyStackIface),
    .free_fn = z_transfer2_ps_iface_free,
  },
  .set_verdict = z_transfer2_ps_iface_set_stacked_verdict,
  .set_content_hint = z_transfer2_ps_iface_set_content_hint,
  .get_content_hint = z_transfer2_ps_iface_get_content_hint
};

Z_CLASS_DEF(ZTransfer2PSIface, ZProxyStackIface, z_transfer2_ps_iface_funcs);

/**
 * z_transfer2_buffer_empty:
 * @self: ZTransfer2Buffer instance
 *
 * This function returns TRUE when the buffer specified by @self contains no
 * data.