Example #1
0
int
send_ntlm_packet (unsigned char *packet, char *method)
{

  /*takes a url, host, and posts it */
  s_string (method);
  s_string (" ");
  s_string (url);

  s_string (" HTTP/1.1\r\n");
  s_string ("Host: ");
  s_string (host);
  //s_string ("localhost");
  s_string ("\r\n");
  s_string ("Authorization: NTLM ");
  s_string (packet);
  s_string ("\r\n");

  s_string ("Connection: Keep-Alive\r\n");
  //s_string ("User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)\r\n");
  s_string
    ("Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\r\n");
  //s_string ("Accept-Encoding: \r\n");
  s_string ("Accept-Language: en\r\n");
  s_string ("Accept-Charset: iso-8859-1,*,utf-8\r\n");
  s_string ("Content-Type: application/x-www-form-urlencoded\r\n");
  s_string ("Content-Length: ");
  s_blocksize_string ("post", 7);
  s_string ("\r\n\r\n");
  s_block_start ("post");
  do_body ();			/*here is the magic body */
  s_block_end ("post");
  if (spike_send () == 0)	/*failure */
    {
      printf ("Couldn't connect to host or send data!\r\n");
      return 0;
    }

  printf("sent: \n%s\n",getcurrentspike()->databuf);

  return 1;
}
Example #2
0
static GstFlowReturn
gst_bayer2rgb_transform (GstBaseTransform * base, GstBuffer * inbuf,
    GstBuffer * outbuf)
{
  GstBayer2RGB *filter = GST_BAYER2RGB (base);
  uint8_t *input, *output;

  /*
   * We need to lock our filter params to prevent changing
   * caps in the middle of a transformation (nice way to get
   * segfaults)
   */
  GST_OBJECT_LOCK (filter);

  GST_DEBUG ("transforming buffer");
  input = (uint8_t *) GST_BUFFER_DATA (inbuf);
  output = (uint8_t *) GST_BUFFER_DATA (outbuf);
  do_corners (input, output, filter);
  do_row0_col0 (input, output, filter);
  do_body (input, output, filter);

  GST_OBJECT_UNLOCK (filter);
  return GST_FLOW_OK;
}