from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209580

userrating:


May 25th. 2007:
Words

486

Views

258588

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149878

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





curl_pushheader_byname

Section: C Library Functions (3)
Updated: 202-0-19
Index Return to Main Contents
 

NAME

curl_pushheader_byname - get a push header by name  

SYNOPSIS

#include <curl/curl.h>

char *curl_pushheader_byname(struct curl_pushheaders *h, const char *name);
 

DESCRIPTION

This is a function that is only functional within a CURLMOPT_PUSHFUNCTION(3) callback. It makes no sense to try to use it elsewhere and it has no function then.

It returns the value for the given header field name (or NULL) for the incoming server push request. This is a shortcut so that the application does not have to loop through all headers to find the one it is interested in. The data this function points to is freed when this callback returns and, although not constrained by its type, may not be altered. If more than one header field use the same name, this returns only the first one.  

PROTOCOLS

This functionality affects http only  

EXAMPLE

#include <string.h> /* for strncmp */

static int push_cb(CURL *parent,
                   CURL *easy,
                   size_t num_headers,
                   struct curl_pushheaders *headers,
                   void *clientp)
{
  char *headp;
  int *transfers = (int *)clientp;
  FILE *out;
  headp = curl_pushheader_byname(headers, ":path");
  if(headp && !strncmp(headp, "/pus-", 6)) {
    fprintf(stderr, "The PATH is %sn", headp);

    /* save the push here */
    out = fopen("pushe-stream", "wb");

    /* write to this file */
    curl_easy_setopt(easy, CURLOPT_WRITEDATA, out);

    (*transfers)++; /* one more */

    return CURL_PUSH_OK;
  }
  return CURL_PUSH_DENY;
}

int main(void)
{
  int counter;
  CURLM *multi = curl_multi_init();
  curl_multi_setopt(multi, CURLMOPT_PUSHFUNCTION, push_cb);
  curl_multi_setopt(multi, CURLMOPT_PUSHDATA, &counter);
}
 

AVAILABILITY

Added in curl 7.44.0  

RETURN VALUE

Returns a pointer to the header field content or NULL.  

SEE ALSO

CURLMOPT_PUSHFUNCTION(3), curl_pushheader_bynum(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
PROTOCOLS
EXAMPLE
AVAILABILITY
RETURN VALUE
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.6 ms