示例#1
0
static int32_t ghttp_send(struct s_client * client, uchar *buf, int32_t l)
{
  cs_debug_mask(D_CLIENT, "%s: sending %d bytes", client->reader->label, l);
  if(!client->pfd) {
    //disconnected? try reinit.
    cs_debug_mask(D_CLIENT, "%s: disconnected?", client->reader->label);
    ghttp_client_init(client);
  }
  return send(client->pfd, buf, l, 0);
}
示例#2
0
static int32_t ghttp_send_int(struct s_client *client, uchar *buf, int32_t l)
{
	cs_debug_mask(D_CLIENT, "%s: sending %d bytes", client->reader->label, l);
	if(!client->pfd)
	{
		// disconnected? try reinit.
		cs_debug_mask(D_CLIENT, "%s: disconnected?", client->reader->label);
		ghttp_client_init(client);
	}

#ifdef WITH_SSL
	s_ghttp *context = (s_ghttp *)client->ghttp;
	if(client->reader->ghttp_use_ssl)
		{ return SSL_write(context->ssl_handle, buf, l); }
#endif
	return send(client->pfd, buf, l, 0);
}