7¤0ì©7]RhWÄ9_<Ÿ_<À ¯r8ð@«ž“…æUaFCh´п¥¤6‘NŸP£$QVºïùÐØi€Ó;ÆfõQýݵSÌ!ˆGënÃÅ*u£d†ãñXH.Òê`€‰Š%�Œʣ‘H ‡á`ÅAD1 QRJ¤¬ä7V9ë”!Dn class="refpurpose"> — low-level HTTP request handling
ne_add_request_header — add headers to a request
ne_get_response_header — functions to access response headers
ne_set_useragent — common properties for HTTP sessions
ne_set_request_flag — set and retrieve per-request flags
ne_set_request_body_buffer — include a message body with a request
.fi .ft .HP \w'void\ ne_buffer_destroy('u .BI "void ne_buffer_destroy(ne_buffer\ *" "buf" ");" .HP \w'char\ *ne_buffer_finish('u .BI "char *ne_buffer_finish(ne_buffer\ *" "buf" ");" .SH "DESCRIPTION" .PP \fBne_buffer_destroy\fR frees all memory associated with the buffer\&. \fBne_buffer_finish\fR frees the buffer structure, but not the actual string stored in the buffer, which is returned and must be \fBfree\fR()d by the caller\&. .PP Any use of the buffer object after calling either of these functions gives undefined behaviour\&. .SH "RETURN VALUE" .PP \fBne_buffer_finish\fR returns the \fBmalloc\fR\-allocated string stored in the buffer\&. .SH "EXAMPLES" .PP An example use of \fBne_buffer_finish\fR; the \fBduplicate\fR function returns a string made up of \fIn\fR copies of \fIstr\fR: .sp .if n \{\ .RS 4 .\} .nf static char *duplicate(int n, const char *str) { ne_buffer *buf = ne_buffer_create(); while (n\-\-) { ne_buffer_zappend(buf, str); } return ne_buffer_finish(buf); } .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP ne_buffer, ne_buffer_create, ne_buffer_zappend .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br .so man3/ne_session_proxy.3 .so man3/ne_buffer_create.3 .so man3/ne_buffer_append.3 .so man3/ne_addr_resolve.3 ne_get_response_headerne_request_dispatch or ne_begin_request was zero).

If the response includes a Location header, the ne_get_response_location function parses and resolves the URI-reference relative to the request target. If a fragment ("#fragment") is applicable to the request target, it can be passed as an argument to allow appropriate relative resolution.

The ne_get_response_retry_after function parses any Retry-After header included in the response. If the header value uses a relative time, it is interpreted relative to the time the function was invoked, rather than the time the response was received, so the function should be used directly after dispatching the request.

Return value

ne_get_status returns a pointer to the HTTP status object giving the result of a request. This pointer is valid until the associated request object is destroyed.

ne_get_response_location returns a malloc-allocated ne_uri object, or NULL if either the URI in the Location header could not be parsed or the Location header was not present.

ne_get_response_retry_after returns a time_t value, or zero if either no Retry-After header was included or the header value could not be parsed.

Examples

Display the response status code of applying the HEAD method to some resource.

ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
if (ne_request_dispatch(req))
   /* handle errors... */
else
   printf("Response status code was %d\n", ne_get_status(req)->code);
ne_request_destroy(req);
", int\ " "timeout" ");" .HP \w'void\ ne_set_connect_timeout('u .BI "void ne_set_connect_timeout(ne_session\ *" "session" ", int\ " "timeout" ");" .HP \w'const\ char\ *ne_get_scheme('u .BI "const char *ne_get_scheme(ne_sesssion\ *" "session" ");" .HP \w'const\ char\ *ne_get_server_hostport('u .BI "const char *ne_get_server_hostport(ne_sesssion\ *" "session" ");" .SH "DESCRIPTION" .PP The User\-Agent request header is used to identify the software which generated the request for statistical or debugging purposes\&. neon does not send a User\-Agent header unless a call is made to the \fBne_set_useragent\fR\&. \fBne_set_useragent\fR must be passed a product string conforming to RFC2616\*(Aqs product token grammar; of the form "Product/Version"\&. .PP When neon reads from a socket, by default the read operation will time out after 60 seconds, and the request will fail giving an \fBNE_TIMEOUT\fR error\&. To configure this timeout interval, call \fBne_set_read_timeout\fR giving the desired number of seconds as the \fItimeout\fR parameter\&. .PP When a connection is being established to a server, normally only the system\*(Aqs TCP timeout handling will apply\&. To configure a specific (and probably shorter) timeout, the \fBne_set_connect_timeout\fR can be used, giving the desired number of seconds as the \fItimeout\fR parameter\&. If 0 is passed, then the default behaviour of using the system TCP timeout will be used\&. .PP The scheme used to initially create the session will be returned by \fBne_get_scheme\fR\&. .PP The hostport pair with which the session is associated will be returned by the \fBne_get_server_hostport\fR; for example www\&.example\&.com:8080\&. Note that the :port will be omitted if the default port for the scheme is used\&. .SH "EXAMPLES" .PP Set a user\-agent string: .sp .if n \{\ .RS 4 .\} .nf ne_session *sess = ne_session_create(\&.\&.\&.); ne_set_useragent(sess, "MyApplication/2\&.1"); .fi .if n \{\ .RE .\} .PP Set a 30 second read timeout: .sp .t">NE_FEATURE_SSL

Indicates support for SSL/TLS

NE_FEATURE_ZLIB

Indicates support for compressed responses

NE_FEATURE_IPV6

Indicates support for IPv6

NE_FEATURE_LFS

Indicates support for large files

NE_FEATURE_SOCKS

Indicates support for SOCKSv5

NE_FEATURE_TS_SSL

Indicates support for thread-safe SSL initialization — see ne_sock_init

NE_FEATURE_GSSAPI

Indicates support for Negotiate authentication via GSSAPI

NE_FEATURE_LIBPXY

Indicates support for libproxy (in ne_session_system_proxy)

Return value

ne_has_support returns non-zero if the given feature is supported, or zero otherwise.

History

The NE_FEATURE_GSSAPI and NE_FEATURE_LIBPXY constants are only available in neon 0.34.0 and later.

See also

ne_version_match, ne_ssl_cert_signedby. The cert object given is not valid after the callback returns.

Return value

The verification callback must return zero to indicate that the certificate should be trusted; and non-zero otherwise (in which case, the connection will fail).

Examples

The following code implements an example verification callback, using the dump_cert function from ne_ssl_cert_subject to display certification information. Notice that the hostname of the server used for the session is passed as the userdata parameter to the callback.

static int
my_verify(void *userdata, int failures, const ne_ssl_certificate *cert)
{
  const char *hostname = userdata;

  dump_cert(cert);

  puts("Certificate verification failed - the connection may have been "
       "intercepted by a third party!");

  if (failures & NE_SSL_IDMISMATCH) { 
    const char *id = ne_ssl_cert_identity(cert);
    if (id) 
      printf("Server certificate was issued to '%s' not '%s'.\n",
             id, hostname);
    else
      printf("The certificate was not issued for '%s'\n", hostname);
  }

  if (failures & NE_SSL_UNTRUSTED)
    puts("The certificate is not signed by a trusted Certificate Authority.");

  /* ... check for validity failures ... */

  if (prompt_user())
    return 1; /* fail verification */
  else
    return 0; /* trust the certificate anyway */
}

int
main(...)
{
  ne_session *sess = ne_session_create("https", "some.host.name", 443);
  ne_ssl_set_verify(sess, my_verify, "some.host.name");
  ...
}

See also

ne_ssl_trust_cert,

#include <ne_utils.h>

typedef struct {
    int major_version;
    int minor_version;
    int code;
    int klass;
    char *reason_phrase;
} ne_status;

Description

The ne_status type represents an HTTP response status; used in response messages giving a result of request. The major_version and minor_version fields give the protocol version supported by the server issuing the response. The code field gives the status code of the result (lying between 100 and 599 inclusive), and the klass field gives the class, which is equal to the most significant digit of the status. The reason_phrase field gives a human-readable string describing the status, which is purely informational (and optional) - any interpretation of the response status must be done using the klass and/or code fields.

There are five classes of response status code defined for HTTP/1.1 (see RFC 9110 ẞ15):

1xx

Informational response.

2xx

Success: the operation was successful

3xx

Redirection
  • A end-element (state = 50, "age")
  • A start-element (parent = 42, "name") → decline
  • B start-element (parent = 42, "name") → accept, state = 99
  • B character-data (state = 99, "Bob")
  • B end-element (state = 99, "name")
  • A end-element (state = 42, "cat")
  • To avoid collisions between state integers used by different handlers, the interface definition of any handler includes the range of integers it will use.

    XML namespaces

    To support XML namespaces, every element name is represented as a (namespace, name) pair. The start-element and end-element callbacks are passed namespace and name strings accordingly. If an element in the XML document has no declared namespace, the namespace given will be the empty string, "".



    [1] This “problem” only needs solving because the SAX interface is so inflexible when implemented as C function callbacks; a better approach would be to use an XML parser interface which is not based on callbacks.

    < was specified)\&. \fBne_ssl_clicert_name\fR can be used when the client certificate is in either the encrypted or decrypted state, and will return the same string for the lifetime of the object\&. .PP The function \fBne_ssl_clicert_owner\fR returns the certificate part of the client certificate; it must only be called if the client certificate is in the \fIdecrypted\fR state\&. .PP When the client certificate object is no longer needed, the \fBne_ssl_clicert_free\fR function should be used to destroy the object\&. .SH "RETURN VALUE" .PP \fBne_ssl_clicert_read\fR, \fBne_ssl_clicert_import\fR and \fBne_ssl_clicert_fromuri\fR all return a client certificate object, or NULL if the certificate could not be read/imported\&. \fBne_ssl_clicert_encrypted\fR returns zero if the object is in the decrypted state, or non\-zero if it is in the encrypted state\&. \fBne_ssl_clicert_name\fR returns a NUL\-terminated friendly name string, or NULL\&. \fBne_ssl_clicert_owner\fR returns a certificate object\&. .SH "EXAMPLES" .PP The following code reads a client certificate and decrypts it if necessary, then loads it into an HTTP session\&. .sp .if n \{\ .RS 4 .\} .nf ne_ssl_client_cert *ccert; ccert = ne_ssl_clicert_read("/path/to/client\&.p12"); if (ccert == NULL) { /* handle error\&.\&.\&. */ } else if (ne_ssl_clicert_encrypted(ccert)) { char *password = prompt_for_password(); if (ne_ssl_clicert_decrypt(ccert, password)) { /* could not decrypt! handle error\&.\&.\&. */ } } ne_ssl_set_clicert(sess, ccert); .fi .if n \{\ .RE .\} .SH "HISTORY" .PP \fBne_ssl_clicert_import\fR was added in neon 0\&.30\&.0\&. \fBne_ssl_clicert_fromuri\fR was added in neon 0\&.35\&.0\&. .SH "SEE ALSO" .PP ne_ssl_cert_read .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br .SH "REFERENCES" .IP " 1." 4 PKCS#11 URIs .RS 4 \%https://www.rfc-editor.org/rfc/rfc7512.html .RE ne_ssl_cert_cmp</titleczytać rozmiaru kawałka�Nie można odczytac odpowiedzi połączenia�Nie można odczytać początkowej odpowiedzi od proxy�Nie można odczytać odpowiedzi logowania�Nie można odczytać ciała odpowiedzi�Nie można odczytać odpowiedzi od proxy�Nie można odczytać linii statusu�Nie można rozwiązać nazwy hosta `%s': %s�Nie można szukać przesunięcia %s pliku ciała żądania: %s�Nie można wysłać żądania połączenia�Nie można wysłać wiadomości logowania�Nie można wysłać wiadomości do proxy�Nie można wysłać żądania�Nie można wysłać ciała żądania�Nie można zweryfikować certyfikatu serwera: %s�Nie można pisać do pliku: %s�Porażka wzajemnego uwierzytelniania Digest: niezgodność posłańca klienta�Porażka wzajemnego uwierzytelniania Digest: nie można parsować licznika posłańca�Porażka wzajemnego uwierzytelniania Digest: brakujące parametry�Porażka wzajemnego uwierzytelniania Digest: niezgodność licznika posłańca (%u nie %u)�Porażka wzajemnego uwierzytelniania Digest: niezgodność request-digest mismatch�Błąd podczas odczytywania nagłówków odpowiedzi�Błąd autentykacji GSSAPI: �Porażka GSSAPI (kod %u)�Host nieznaleziony�Nieprawidłowy Znacznik Kolejności Bajtów�Nieprawidłowe Content-Length w odpowiedzi�Niewłaściwa linia statusu HTTP w elemencie statusu w linii %d odpowiedzi: Linia statusu była: %s�Nieprawidłowa wersja w odpowiedzi połączenia�Nieprawidłowa wersja w odpowiedzi logowania�Nieprawidłowa wersja w odpowiedzi proxy�Odpowiedź LOCK nie zawiera nagłówka Lock-Token�Linia zbyt długa�weryfikacja odpowiedzi Negotiate nie udała się: niewłaściwy żeton nagłówka odpowiedzi�porażka weryfikacji odpowiedzi Negotiate: %s�Brak akceptowalnej metody uwierzytelniania�Nie zwrócono żadnej aktywnej blokady dla <%s> w odpowiedzi LOCK refresh�Zakres nie może być usatysfakcjonowany�Zasób nie obsługuje zakresowych żądań GET�Odpowiedź nie zawierała wymaganego zakresu�Odpowiedź przekroczyła maksy��$���™ �����¾ ��!���Ð �����ò ��8��� �����G �����f ��!���~ ��;���  ��=���Ü ����������1�����K��(���f��$���������´��+���Ñ��'���ý�����%�����D�����^��*���{�����¦�����Á��"���Þ�������#�����4���@�����u�����”�����±�����Ñ�����è��'��������,��;���H��A���„��8���Æ��F���ÿ��=���F�����„�����£�����Á�����Ú�����é��"�����V���$�� ���{�����œ��!���»��'���Ý�� �����E�����+���Y��#���…��8���©�����â��-���û��(���)��1���R��'���„�����¬��"���Å�����è��#���ÿ�����#�� ���<��:���J�����…��&���ž�����Å�����Ü��(���ø��C���!��%���e��+���‹�����·�� ���Ó��'���ß��%����� ���-��#���;�����_��0���~�����¯�����¾�� ���Ñ�����ß�����ú����������-�����E��+���b�����Ž�����¤��(���½�����æ��*���������+�����3�����D��%���Y��*�����"���ª�����Í�����å��%���û�� ���!�����B�����V�����e��$���{����� �����»��2���Û��%��������4��“��M�����á��%���ñ��7�����1���O�����������Ÿ�����¿��"���×��(���ú��2���#�����V��!���n��2������,���Ã�����ð��,��� ��&���9 ��<���` ��"���� �����À ��(���Ý ��<���!��B���C!�� ���†!�� ���’!��&���³!��0���Ú!��-��� "��#���9"��>���]"��5���œ"��*���Ò"��&���ý"��+���$#��5���P#��)���†#��&���°#��(���×#��"����$��+���#$��>���O$��*���Ž$��)���¹$��(���ã$����� %��$���*%��0���O%�����€%��M���Ÿ%��U���í%��A���C&��Z���…&��R���à&��3���3'�����g'�����„'������'��+���°'��*���Ü'��c���(��/���k(��,���›(��(���È(��1���ñ(�����#)��\���5)��-���’)��*���À)��I���ë)��(���5*��.���^*��,����*��<���º*��8���÷*��!���0+��.���R+������+��'���™+�����Á+�����Û+��J���ê+��#���5,��'���Y,��+����,�� ���­,��4���Î,��B���-��*���F-��/���q-�����¡-�����¾-��-���×-��-���.�����3.��%���C.��,���i.��G���–.�����Þ.�����ô.����� /�����/�����1/�� ���L/�����m/��$���€/��'���¥/�����Í/�����ä/��$���þ/�����#0��-���A0�����o0�����x0�����‹0��(���£0��*���Ì0��-���÷0�����%1�����D1��%���]1��"���ƒ1�����¦1�����º1�����×1��4���í1�� ���"2��0���C2��:���t2��#���¯2�����Ó2������������¡ კოდი არასწორია�მოლაპარაკების პასუხის გადამოწმების შეცდომა: %s�დამაკმაყოფილებელი ავთენტიკაციის მეთოდის გარეშე�LOCK-ის განახლების პასუხში <%s>-ის activelock არ დაბრუნებულა�ნაადრევი EOF მოთხოვნის სხეულის ფაილში�დაპაზონი დამაკმაყოფილებელი არაა�რესურსს დიაპაზონის შემცველ GETი მოთხოვნების მხარდაჭერა არ გააჩნია�პასუხი მოთხოვნილ დიაპაზონს არ შეიცავს�პასუხის თავსართის ველების მაქსიმალურ რიცხვს სცდება�პასუხი თვისებების მაქსიმალურ რაოდენობას აჭარბებს�პასუხის თავსართი მეტისმეტად გრძელია�პასუხს %s-სთვის activelock აკლია�ოპერაციის თავიდან ცდა�SSL გაფრთხილება მიღებულია: %s�ენტროპიის ნაკლებობის გამო SSL-ი გათიშულია�SSL -ის შეცდომის კოდი %d/%d/%lu�SSL-ის შეცდომა: %s�SSL მიმოცვლის შეცდომა. მოთხოვნილი კლიენტის სერტიფიკატი: %s�SSL მიმოცვლის შეცდომა: %s�SSL სერვერმა სერტიფიკატი არ წარმოადგინა�SSL სოá ��"���( �����K ��&���g �����Ž �����  ��*���µ ��$���à �������!��������9��8���U�����Ž�����­��!���Å��;���ç��=���#�����a�����x�����’��(���­��$���Ö�����û��+�����'���D�����l�����‹�����¥��*���Â�����í�������"���%�����H��A���c��#���¥��4���É��)���þ�����(�����G�����d�����„�����›��'���·�����ß��;���û��A���7��8���y��F���²��=���ù�����7��$���V�� ���{�����œ�����º�����Ó�����â�����ù��"�����V���4�� ���‹�����¬��!���Ë��'���í�� �����!���#��E���E��+���‹��#���·��8���Û��"��������7��-���P��(���~��1���§��'���Ù�������"��������=�����M��#���d�����ˆ�� ���¡��:���¯�����ê��&��������*��@���A�����‚�����š��(���¶��C���ß��%���#��+���I�����u�� ���‘��'������%���Å�� ���ë��#���ù�������0���<�����m�����|�� ���������������¸��;���Î����� �����'�����?��+���\�����ˆ�����ž��(���·��7���à�������*���2�����]�����e�����v��%���‹��*���±��"���Ü�����ÿ�������%���-��%���S�� ���y�����š�����®�����½��$���Ó�����ø�������2���3��%���f�����Œ��‹��¥��Ž���1!�����À!��a���Ù!��q���;"��]���­"��1��� #��.���=#��J���l#��c���·#��J���$��r���f$��1���Ù$��8��� %��p���D%��]���µ%��4���&��i���H&��P���²&��u���'��N���y'��A���È'��^��� (��~���i(��µ���è(��M���ž)��L���ì)��]���9*��‰���—*��p���!+��Q���’+��…���ä+��ˆ���j,��c���ó,��Z���W-��c���²-��y���.��]����.��c���î.��]���R/��c���°/��Í���0��`���â0��¥���C1��ª���é1��i���”2��l���þ2������k3��V���í3��c���D4��|���¨4��B���%5��²���h5��Ý���6��´���ù6��Õ���®7��¢���„8��i���'9��z���‘9��}��� :��F���Š:��3���Ñ:��2���;��6���8;��f���o;��@���Ö;��Ì���<��]���ä<��W���B=��W���š=��K���ò=��5���>>��w���t>��Ô���ì>��|���Á?��„���>@��€���Ã@��a���DA��Y���¦A��¯����B��g���°B��Œ���C��ˆ���¥C��c���.D��@���’D��;���ÓD��E���E��k���UE��;���ÁE��$���ýE��”���"F��9���·F��g���ñF��K���YG��±���¥G��>���WH��J���–H��z���áH��”���\I��v���ñI��u���hJ��W���ÞJ��*���6K��r���aK��v���ÔK��(���KL��?���tL��Z���´L��’���M��-���¢M��)���ÐM��)���úM��V���$N��S��pend, ne_buffer_concat \- append data to a string buffer .SH "SYNOPSIS" .sp .ft B .nf #include <ne_string\&.h> .fi .ft .HP \w'void\ ne_buffer_append('u .BI "void ne_buffer_append(ne_buffer\ *" "buf" ", const\ char\ *" "string" ", size_t\ " "len" ");" .HP \w'void\ ne_buffer_zappend('u .BI "void ne_buffer_zappend(ne_buffer\ *" "buf" ", const\ char\ *" "string" ");" .HP \w'void\ ne_buffer_concat('u .BI "void ne_buffer_concat(ne_buffer\ *" "buf" ", const\ char\ *" "str" ", \&.\&.\&.);" .SH "DESCRIPTION" .PP The \fBne_buffer_append\fR and \fBne_buffer_zappend\fR functions append a string to the end of a buffer; extending the buffer as necessary\&. The \fIlen\fR passed to \fBne_buffer_append\fR specifies the length of the string to append; there must be no NUL terminator in the first \fIlen\fR bytes of the string\&. \fBne_buffer_zappend\fR must be passed a NUL\-terminated string\&. .PP The \fBne_buffer_concat\fR function takes a variable\-length argument list following \fIstr\fR; each argument must be a \fBchar *\fR pointer to a NUL\-terminated string\&. A NULL pointer must be given as the last argument to mark the end of the list\&. The strings (including \fIstr\fR) are appended to the buffer in the order given\&. None of the strings passed to \fBne_buffer_concat\fR are modified\&. .SH "EXAMPLES" .PP The following code will output "Hello, world\&. And goodbye\&."\&. .sp .if n \{\ .RS 4 .\} .nf ne_buffer *buf = ne_buffer_create(); ne_buffer_zappend(buf, "Hello"); ne_buffer_concat(buf, ", world\&. ", "And ", "goodbye\&.", NULL); puts(buf\->data); ne_buffer_destroy(buf); .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP ne_buffer, ne_buffer_create, ne_buffer_destroy .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br '\" t .\" Title: ne_buffer_create .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 15 July 2025 .\" Manual: neon API reference .\" Source: neon 0.35.0 .\" Language: English .\" .TH "NE_BUFFER_CR('u .BI "void ne_set_proxy_auth(ne_session\ *" "session" ", ne_auth_creds\ " "callback" ", void\ *" "userdata" ");" .HP \w'void\ ne_forget_auth('u .BI "void ne_forget_auth(ne_session\ *" "session" ");" .SH "DESCRIPTION" .PP The \fBne_auth_creds\fR function type defines a callback which is invoked when a server or proxy server requires user authentication for a particular request\&. The \fIrealm\fR string is supplied by the server\&. The \fIattempt\fR is a counter giving the number of times the request has been retried with different authentication credentials\&. The first time the callback is invoked for a particular request, \fIattempt\fR will be zero\&. .PP To retry the request using new authentication credentials, the callback should return zero, and the \fIusername\fR and \fIpassword\fR buffers must contain NUL\-terminated strings\&. The NE_ABUFSIZ constant gives the size of these buffers\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBTip\fR .ps -1 .br .PP If you only wish to allow the user one attempt to enter credentials, use the value of the \fIattempt\fR parameter as the return value of the callback\&. .sp .5v .RE .PP To abort the request, the callback should return a non\-zero value; in which case the contents of the \fIusername\fR and \fIpassword\fR buffers are ignored\&. .PP The \fBne_forget_auth\fR function can be used to discard the cached authentication credentials\&. .SH "EXAMPLES" .sp .if n \{\ .RS 4 .\} .nf /* Function which prompts for a line of user input: */ extern char *prompt_for(const char *prompt); static int my_auth(void *userdata, const char *realm, int attempts, char *username, char *password) { strncpy(username, prompt_for("Username: "), NE_ABUFSIZ); strncpy(password, prompt_for("Password: "), NE_ABUFSIZ); return attempts; } int main(\&.\&.\&.) { ne_session *sess = ne_session_create(\&.\&.\&.); ne_set_server_auth(sess, my_auth, NULL); /* \&.\&.\&. */ } .fi B\-\-help\fR] | [\fB\-\-version\fR]] .SH "DESCRIPTION" .PP The \fBneon\-config\fR script provides information about an installed copy of the neon library\&. The \fB\-\-cflags\fR and \fB\-\-libs\fR options instruct how to compile and link an application against the library; the \fB\-\-version\fR and \fB\-\-support\fR options can help determine whether the library meets the applications requirements\&. .SH "OPTIONS" .PP \fB\-\-cflags\fR .RS 4 Print the flags which should be passed to the C compiler when compiling object files, when the object files use neon header files\&. .RE .PP \fB\-\-libs\fR .RS 4 Print the flags which should be passed to the linker when linking an application which uses the neon library .RE .PP \fB\-\-la\-file\fR .RS 4 Print the location of the libtool library script, libneon\&.la, which can be used to link against neon by applications using libtool\&. .RE .PP \fB\-\-version\fR .RS 4 Print the version of the library .RE .PP \fB\-\-prefix\fR \fIdir\fR .RS 4 If \fIdir\fR is given; relocate output of \fB\-\-cflags\fR and \fB\-\-libs\fR as if neon was installed in given prefix directory\&. Otherwise, print the installation prefix of the library\&. .RE .PP \fB\-\-support\fR \fIfeature\fR .RS 4 The script exits with success if \fIfeature\fR is supported by the library\&. .RE .PP \fB\-\-help\fR .RS 4 Print help message; includes list of known features and whether they are supported or not\&. .RE .SH "EXAMPLE" .PP Below is a Makefile fragment which could be used to build an application against an installed neon library, when the \fBneon\-config\fR script can be found in \fB$PATH\fR\&. .sp .if n \{\ .RS 4 .\} .nf CFLAGS = `neon\-config \-\-cflags` LIBS = `neon\-config \-\-libs` OBJECTS = myapp\&.o TARGET = myapp $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) \-o $(TARGET) $(OBJECTS) $(LIBS) myapp\&.o: myapp\&.c $(CC) $(CFLAGS) \-c myapp\&.c \-o myapp\&.o .fi .if n \{\ .RE .\} .SH "COPYRIGHT" .br Þ•����������$������,�������8���+��9���������������Projend WebDAV methods. This allows you to easily dispatch a GET or a MKCOL request against a resource with a single function call.</p></li><li class="listitem"><p>A low-level interface for HTTP request handling; allowing you to implement requests using arbitrary methods and request headers, capture arbitrary response headers, and so on.</p></li><li class="listitem"><p>Persistent connection support; neon groups a set of requests to a server into a "session"; requests within that session can use a persistent (also known as "keep-alive") connection.</p></li><li class="listitem"><p>Modern HTTP authentication support: a complete implementation of the new authentication standard, RFC2617, supporting the Digest, Basic, and Negotiate protocols. Credentials are supplied by an application-defined callback as appropriate.</p></li><li class="listitem"><p>Proxy server support; a session can be set to use a proxy server. Authentication is supported for the Proxy as well as the origin server. The system's proxy configuration can be optionally used, on some platforms.</p></li><li class="listitem"><p>Complete SSL support; a simple interface for enabling SSL, hiding the complexity of using an SSL library directly. Client certificate support, callback-based server certificate verification, along with functions to load trusted CA certificates. Smartcard-based client certs are also supported via a wrapper interface for PKCS#11 modules.</p></li><li class="listitem"><p>Compressed response support: responses compressed using the "deflate" algorithm can be transparently decompressed.</p></li><li class="listitem"><p>Generic XML parsing interface for handling XML response bodies using SAX-like callbacks. Both the expat and libxml XML parser libraries are supported.</p></li><li class="listitem"><p>WebDAV metadata support; set and remove properties, query properties (PROPFIND); simple interface for retrieving "flat" byte-string properties, more advanced support for parsing "complex" struct"><em>request</em></span>, created by <a class="xref" href="refreq.html#ne_request_create">ne_request_create</a>. HTTP authentication is handled transparently for server and proxy servers, see <a class="xref" href="refauth.html#ne_set_server_auth">ne_set_server_auth</a>; complete SSL/TLS support is also included, see <a class="xref" href="refsslvfy.html#ne_ssl_set_verify">ne_ssl_set_verify</a>.</p></div><div class="refsect1"><a name="id1691"></a><h2>Conventions</h2><p>Some conventions are used throughout the neon API, to provide a consistent and simple interface; these are documented below.</p><div class="refsect2"><a name="id1694"></a><h3>Thread-safeness and global initialization</h3><p>neon itself is implemented to be thread-safe (avoiding any use of global state), but relies on the operating system providing a thread-safe resolver interface. Modern operating systems offer the thread-safe <code class="function">getaddrinfo</code> interface, which neon supports; some others implement <code class="function">gethostbyname</code> using thread-local storage.</p><p>To allow thread-safe use of SSL in the OpenSSL and GnuTLS libraries neon must be configured using the <code class="literal">--enable-threadsafe-ssl</code>; if this is done, locking callbacks will be registered by <a class="xref" href="refsockinit.html#ne_sock_init">ne_sock_init</a>; note that care must be exercised if neon is used in conjunction with another library which uses OpenSSL or GnuTLS.</p><p>Some platforms and libraries used by neon require global initialization before use; notably: </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">The <code class="literal">SIGPIPE</code> signal disposition must be set to <span class="emphasis"><em>ignored</em></span> or otherwise handled to avoid process termination when writing to a socket which has been shutdown by ttle"><a href="refsslcertio.html">ne_ssl_cert_read</a></span><span class="refpurpose"> — functions to read or write certificates to and from files or strings</span></dt><dt><span class="refentrytitle"><a href="refssldname.html">ne_ssl_dname</a></span><span class="refpurpose"> — SSL distinguished name handling</span></dt><dt><span class="refentrytitle"><a href="refsslca.html">ne_ssl_trust_cert</a></span><span class="refpurpose"> — functions to indicate that certificates are trusted</span></dt><dt><span class="refentrytitle"><a href="refsslproto.html">ne_ssl_proto_name</a></span><span class="refpurpose"> — SSL/TLS protocol version to name mapping</span></dt><dt><span class="refentrytitle"><a href="refsslvers.html">ne_ssl_set_protovers</a></span><span class="refpurpose"> — set session SSL/TLS minimum or maximum protocol version</span></dt><dt><span class="refentrytitle"><a href="refsslvfy.html">ne_ssl_set_verify</a></span><span class="refpurpose"> — register an SSL certificate verification callback</span></dt><dt><span class="refentrytitle"><a href="refclicert.html">ne_ssl_client_cert</a></span><span class="refpurpose"> — SSL client certificate handling</span></dt><dt><span class="refentrytitle"><a href="refstatus.html">ne_status</a></span><span class="refpurpose"> — HTTP status structure</span></dt><dt><span class="refentrytitle"><a href="reftok.html">ne_token</a></span><span class="refpurpose"> — string tokenizers</span></dt><dt><span class="refentrytitle"><a href="refvers.html">ne_version_match</a></span><span class="refpurpose"> — library versioning</span></dt><dt><span class="refentrytitle"><a href="refxml.html">ne_xml_create</a></span><span class="refpurpose"> — create and destroy an XML parser</span></dt></dl></dd><dt><span class="bibliography"><a href="biblio.html">Bibliography</a></span></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="xml.html#xml-example">An example XML document</a></dt><BI "ne_session *ne_session_create(const\ char\ *" "scheme" ", const\ char\ *" "host" ", unsigned\ int\ " "port" ");" .HP \w'void\ ne_close_connection('u .BI "void ne_close_connection(ne_session\ *" "session" ");" .HP \w'void\ ne_session_destroy('u .BI "void ne_session_destroy(ne_session\ *" "session" ");" .SH "DESCRIPTION" .PP An \fBne_session\fR object represents an HTTP session \- a logical grouping of a sequence of HTTP requests made to a certain server\&. Any requests made using the session can use a persistent connection, share cached authentication credentials and any other common attributes\&. .PP A new HTTP session is created using the \fBne_session_create\fR function; the \fIhost\fR and \fIport\fR parameters specify the origin server to use, along with the \fIscheme\fR (usually "http")\&. Before the first use of \fBne_session_create\fR in a process, ne_sock_init must have been called to perform any global initialization needed by any libraries used by neon\&. .PP To enable SSL/TLS for the session, pass the string "https" as the \fIscheme\fR, and either register a certificate verification function (see ne_ssl_set_verify) or trust the appropriate certificate (see ne_ssl_trust_cert, ne_ssl_trust_default_ca)\&. .PP The \fIhost\fR parameter must follow the definition of host host in \m[blue]\fBRFC 3986\fR\m[]\&\s-2\u[1]\d\s+2, which can be an IP\-literal or registered (DNS) hostname\&. Valid examples of each: "198\&.51\&.100\&.42" (IPv4 literal address), "[2001:db8::42]" (IPv6 literal, which \fIMUST\fR be enclosed in square brackets), or "www\&.example\&.com" (DNS hostname)\&. The \m[blue]\fBRFC 6874\fR\m[]\&\s-2\u[2]\d\s+2 syntax for scoped IPv6 link\-local literal addresses is also permitted, for example "[fe80::1%25eth0]"\&. .PP The \fIscheme\fR parameter is used to determine the URI for resources identified during request handling\&. Other than special handling of the string "https", no other interpretation or checking of the \fIscheme\fR is performed\&. F------------------------------------ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ne_set_session_flag, ne_get_session_flag \- set and retrieve session flags .SH "SYNOPSIS" .sp .ft B .nf #include <ne_request\&.h> .fi .ft .HP \w'void\ ne_set_session_flag('u .BI "void ne_set_session_flag(ne_session\ *" "sess" ", ne_session_flag\ " "flag" ", int\ " "value" ");" .HP \w'int\ ne_get_session_flag('u .BI "int ne_get_session_flag(ne_session\ *" "sess" ", ne_session_flag\ " "flag" ");" .SH "DESCRIPTION" .PP The \fBne_set_session_flag\fR function enables or disables a session flag\&. Passing a non\-zero \fIvalue\fR argument enables the flag, and zero disables it\&. .PP The following flags are defined: .PP \fBNE_SESSFLAG_PERSIST\fR (default on) .RS 4 disable this flag to prevent use of persistent connections .RE .PP \fBNE_SESSFLAG_ICYPROTO\fR (default off) .RS 4 enable this flag to enable support for non\-HTTP ShoutCast\-style "ICY" responses .RE .PP \fBNE_SESSFLAG_SSLv2\fR .RS 4 this flag is ignored .RE .PP \fBNE_SESSFLAG_RFC4918\fR (default off) .RS 4 enable this flag to enable support for RFC4918\-only WebDAV features; losing backwards\-compatibility with RFC2518 servers .RE .PP \fBNE_SESSFLAG_CONNAUTH\fR (default off) .RS 4 enable this flag if an RFC\-violating connection\-based HTTP authentication scheme is in use .RE .PP \fBNE_SESSFLAG_TLS_SNI\fR (default on) .RS 4 disable this flag if a server is used which does not correctly support the TLS SNI extension .RE .PP \fBNE_SESSFLAG_EXPECT100\fR (default off) .RS 4 enable this flag to enable the request flag \fBNE_REQFLAG_EXPECT100\fR for new requests .RE .PP \fBNE_SESSFLAG_SHAREPOINT\fR (default off) .RS 4 enable this flag to use various workarounds to improve interoperability with SharePoint .RE .PP \fBNE_SESSFLAG_STRICT\fR (default on) .RS 4 disable this flag to parse HTTP/1\&.1 messages without strict requirements introduced in RFC 7230 and later .RE .S"_top">RFC 6874</a> syntax for scoped IPv6 link-local literal addresses is also permitted, for example <code class="literal">"[fe80::1%25eth0]"</code>. </p><p>The <code class="parameter">scheme</code> parameter is used to determine the URI for resources identified during request handling. Other than special handling of the string <code class="literal">"https"</code>, no other interpretation or checking of the <code class="parameter">scheme</code> is performed. For example, if an HTTP-to-FTP proxy is configured, a scheme of <code class="literal">"ftp"</code> could be used to access resources.</p><p>To use a proxy server for the session, it must be configured (see <a class="xref" href="refproxy.html#ne_session_proxy">ne_session_proxy</a>) before any requests are created from session object.</p><p>Further per-session options may be changed using the <a class="xref" href="refsessflags.html#ne_set_session_flag">ne_set_session_flag</a> interface.</p><p>If it is known that the session will not be used for a significant period of time, <code class="function">ne_close_connection</code> can be called to close the connection, if one remains open. Use of this function is entirely optional, but it must not be called if there is a request active using the session.</p><p>Once a session has been completed, <code class="function">ne_session_destroy</code> must be called to destroy the resources associated with the session. Any subsequent use of the session pointer produces undefined behaviour. The session object must not be destroyed until after all associated request objects have been destroyed.</p></div><div class="refsect1"><a name="id2867"></a><h2>Notes</h2><p>If a hostname is passed to <code class="function">ne_session_create</code>, it will be resolved when the first request using the session is dispatched; a DNS resolution failure can only be detected at that time (using the <used to encode an extended parameter value for an HTTP header, as defined in RFC 5987\&. The function takes as arguments the \fIvalue\fR to encode, using a given MIME \fIcharset\fR character set, and \fIlang\fR language tag\&. The extended parameter encoding is used in HTTP protocol specifications to allow easily embedding special characters (such as quote marks, separators or non\-ASCII) in header values\&. .PP In accordance with RFC 5987, the \fIcharset\fR argument must be either \fB"UTF\-8"\fR or \fB"IS0\-8859\-1"\fR, but the \fIlang\fR argument may be NULL\&. .SH "RETURN VALUE" .PP The return value is either: .PP NULL .RS 4 if the value parameter is a "regular parameter" and does not need extended encoding .RE .PP non\-NULL .RS 4 the encoding of the input value as an extended parameter as a NUL\-terminated, malloc\-allocated string .RE .SH "HISTORY" .PP \fBne_strparam\fR is available in neon 0\&.32\&.0 and later\&. .SH "SEE ALSO" .PP \m[blue]\fB\%https://www.rfc-editor.org/rfc/rfc5987.html\fR\m[] .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br Þ•����������T��� ���Œ�������¸���!���¹������Û������÷�����������,�����I��9��e��3���Ÿ��3���Ó��*�����$���2�� ���W��"���x����������������������������������������Could not connect to proxy server�Could not connect to server�Could not parse chunk size�Could not read chunk size�Could not read response body�Could not write to file: %s�Project-Id-Version: sitecopy 0.10.14 Report-Msgid-Bugs-To: https://github.com/notroj/neon PO-Revision-Date: 2001-01-16 07:32+0900 Last-Translator: Nobuyuki Tsuchimura <tutimura@nn.iij4u.or.jp> Language-Team: ja Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8-bit �プロキシーサーバーに接続できません�プロキシーサーバーに接続できません�chunk の大きさを解析できません�chunk の大きさが読めません�response body が読めません�ファイルが書けません: %s�„算法不兼容�陈旧的初始化摘要挑战�非法磋商令牌�证书发行者不被信任�在摘要挑战中的参数丢失�在基本挑战中丢失了领域�非法偏移�被拒绝的 %s 挑战�陈旧的摘要挑战用于新算法或新领域�在摘要挑战中的算法不可识别�.so man3/ne_iaddr_make.3 .so man3/ne_set_useragent.3 Þ•����������”������ ������h��!���i�����‹�����§�����Â�����Ü�����ù����������+�����G�����c�����‚��V���‘�� ���è�����ö��)����"���9�����\�����y�����˜�����¶��!���Õ�����÷����������.��&���J�����q��b���†�����é��(������������������ ���������� ������������������������ ��� ������� ���������������������Could not connect to proxy server�Could not connect to server�Could not parse chunk size�Could not read chunk size�Could not read response body�Could not read status line�Could not send request�Could not send request body�Could not write to file: %s�Error reading response headers�Host not found�Invalid HTTP status line in status element at line %d of response: Status line was: %s�Line too long�Response header too long�Project-Id-Version: sitecopy 0.11.4 Report-Msgid-Bugs-To: https://github.com/notroj/neon PO-Revision-Date: 2002-04-09 11:12+0100 Last-Translator: Petr Prazak <prazak@grisoft.cz> Language-Team: cz Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit �Nelze se připojit k proxy serveru�Nelze se připojit k serveru�Nelze zpracovat velikost bloku�Nelze načíst velikost bloku�Nelze načíst tělo odpovědi�Nelze přečíst stavový řádek�Nelze poslat požadavek�Nelze odeslat tělo požadavku�Nelze zapsat do souboru: %s�Chyba při čtení hlaviček odpovědi�Počítač nenalezen�Neplatná řádka HTTP stavu ve stavovém prvku na řádku %d odpovědi: Stavová řádka byla: %s�Řádek je příliš dlouhý�Hlavička odpovědi je příliš dlouhá�.so man3/ne_get_status.3 '\" t .\" Title: ne_add_request_header .\" ���\��%���r�� ���˜�����¹�����È��2���Þ��%�����<��7�����t�����‰��"���š�����½�����Ú�����ò������� ����� ���+��"���8�����[�����x�����—��6���°�����ç�����ÿ�� ��������6�����I�����_�����u�����������«�����Ã�����Ù�����ì�������%�����3���>�����r�����…�����ž��0���¶��3���ç��'�����K���C��0���������À�����Ö�����ì������������"���6��W���Y��&���±�� ���Ø��0���â�������.���0�����_�����u�����‘��*���°��$���Û��������%��������6��"���N�����q�����Œ�����œ�����¼�����Ö�����é��8��������>�� ���]�� ���~�����‹�����ª��0���Ê�����û����� �����!�����3�����F��*���Y�����„��$���—�����¼�����Ó��$���ì����������0�����C��!���_��!������ ���£�����°��0���Ç��'���ø��������� ������� ���6������4�������������������������<�����������V�������3����������D���J���!��� ���Y������U���W���T������ �������E���8������1���2����������5���#���,�������������L����������K���[���;���O���=������������Z���I�������C���*���������������&�������0�������:���R���M���'�������F���X������-���������������?���������(������B���@�������9�������������)���/���$���A��� �������S������7���������G������H���N�����������"���%�������Q���+�������>������� ���.���\��������������P��������%s: %s (code %d)�%s: connection timed out�%s: connection was closed by proxy server�%s: connection was closed by server�Certificate verification error: %s�Chunk delimiter was invalid�Client certificate verification failed�Connection closed�Connection timed out�Could not authenticate to proxy server: %s�Could not authenticate to server: %s�Could not connect to proxy server�Could not connect to server�Could not create SSL connection through proxy server: %s�Could not create SSL structure�Could not create socket�Could not determine file size: %s�Could not inflate data�Could not initialize zlib�Could not parse chunk size�Could not parse redirect destination URL�Could not parse response statusautomatically without having to be specified).</p></li><li class="listitem"><p>The 'src' directory of the neon package can be imported directly into your application, if you do not wish to add an external dependency. If you wish to bundle, use the NEON_BUNDLED macro to configure neon in your application: here, the neon sources are bundled in a directory called 'libneon':</p><pre class="programlisting">NEON_BUNDLED(libneon, ...)</pre><p>If your application supports builds where srcdir != builddir, you should use the NEON_VPATH_BUNDLED macro like this:</p><pre class="programlisting">NEON_VPATH_BUNDLED(${srcdir}/libneon, libneon, ...)</pre><p>If you use this macro, a '--with-included-neon' option will be added to the generated configure script. This allows the user to force the bundled neon to be used in the application, rather than any neon library found on the system. If you allow neon to be configured this way, you must also configure an XML parser. Use the NEON_XML_PARSER macro to do this.</p></li><li class="listitem"><p>The final argument to the _BUNDLED macros is a set of actions which are executed if the bundled build *is* chosen (rather than an external neon which might have been found on the user's system). In here, use either the NEON_LIBTOOL_BUILD or NEON_NORMAL_BUILD macro to set up the neon Makefile appropriately: including adding the neon source directory to the recursive make.</p></li></ul></div><p>A full fragment might be:</p><pre class="programlisting">NEON_BUNDLED(libneon, [ NEON_NORMAL_BUILD NEON_XML_PARSER SUBDIRS="libneon $SUBDIRS" ])</pre><p>This means the bundled neon source directory (called 'libneon') is used if no neon is found on the system, and the standard XML parser search is used.<title="Feature list"><link rel="next" href="example.html" title="Example application"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">How to use neon from your application</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="features.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="example.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="using"></a>How to use neon from your application</h2></div></div></div><p>This section describes how to add neon support to an application. If you just want to quickly try out neon, use the <a class="xref" href="refconfig.html" title="neon-config"><span class="refentrytitle">neon-config</span></a> script.</p><p>The neon source code is designed to be easily embedded into an application source tree. neon has no dependencies on libraries other than an SSL toolkit and XML parser, though the source tree can be configured to have no support for SSL or XML if desired. To configure the neon source code some <a class="ulink" href="http://www.gnu.org/software/autoconf/" target="_top">GNU autoconf</a> macros are supplied, which can be used in a number of ways, as follows:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>autoconf macros are distributed in the 'macros' subdirectory of the neon distribution. Use the NEON_LIBRARY macro from your configure.in to check for the presence of the neon library installed on the system. The macro adds an '--with-neon=...' argument to configure, which allows the user to specify a location for the library (the standard /usr and /usr/local direst address; \fBne_addr_next\fR returns the next address after the most recent call to \fBne_addr_next\fR or \fBne_addr_first\fR, or NULL if there are no more addresses\&. The \fBne_inet_addr\fR pointer returned by these functions can be passed to \fBne_sock_connect\fR to connect a socket\&. .PP If the NE_ADDR_CANON flag was used with \fBne_addr_resolve\fR, the canonical hostname can be retrieved using \fBne_addr_canonical\fR\&. .PP After the address object has been used, it should be destroyed using \fBne_addr_destroy\fR\&. .SH "RETURN VALUE" .PP \fBne_addr_resolve\fR returns a pointer to an address object, and never NULL\&. \fBne_addr_error\fR returns the \fIbuffer\fR parameter\&. .SH "EXAMPLES" .PP The code below prints out the set of addresses associated with the hostname www\&.google\&.com\&. .sp .if n \{\ .RS 4 .\} .nf ne_sock_addr *addr; char buf[256]; addr = ne_addr_resolve("www\&.google\&.com", 0); if (ne_addr_result(addr)) { printf("Could not resolve www\&.google\&.com: %s\en", ne_addr_error(addr, buf, sizeof buf)); } else { const ne_inet_addr *ia; printf("www\&.google\&.com:"); for (ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) { printf(" %s", ne_iaddr_print(ia, buf, sizeof buf)); } putchar(\*(Aq\en\*(Aq); } ne_addr_destroy(addr); .fi .if n \{\ .RE .\} .SH "HISTORY" .PP \fBne_addr_canonical\fR was added in neon 0\&.30\&.0\&. .SH "SEE ALSO" .PP ne_iaddr_print .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br .so man3/ne_ssl_cert_identity.3 .so man3/ne_set_useragent.3 .so man3/ne_set_request_body_buffer.3 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Parsing XML ne_buffer_create
    #! /bin/sh # Originally from libxml, Copyright (C) Daniel Veillard # Modifications for neon Copyright (C) 2000-2006 Joe Orton. prefix=/usr exec_prefix=${prefix} includedir=${prefix}/include libdir=${exec_prefix}/lib usage() { cat < creates an ne_inet_addr object from a raw binary network address; for instance the four bytes 0x7f 0x00 0x00 0x01 represent the IPv4 address 127.0.0.1. The object returned is suitable for passing to ne_sock_connect. A binary IPv4 address contains four bytes; a binary IPv6 address contains sixteen bytes; addresses passed must be in network byte order.

    ne_iaddr_cmp compares two network address objects; returning zero only if they are identical. The objects need not have the same address type; if the addresses are not of the same type, the return value is guaranteed to be non-zero.

    ne_iaddr_print prints a human-readable string representation of a network address into a buffer, for instance the string "127.0.0.1".

    ne_iaddr_typeof returns the type of the given network address object.

    ne_iaddr_parse parses a string representation of a network address (such as "127.0.0.1" and creates a network address object to represent the parsed address.

    ne_iaddr_raw writes the raw byte representation of a network address to the provided buffer. The bytes are written in network byte order; the buffer must be of suitable length for the type of address (4 bytes for an IPv4 address, 16 bytes for an IPv6 address).

    ne_iaddr_reverse performs a reverse name lookup on the address object, writing the (first) hostname associated with the IP address to the provided buffer. If the hostname is longer than the buffer it will be silently truncated; on success the string written to the buffer is always ellspacing: 0; cellpadding: 0;">char *ne_strdup(const char *s);

     
    char *ne_strndup(const char *s,
     size_t size);
     
    void ne_oom_callback(void (*callback)(void));
     

    Description

    The functions ne_malloc, ne_calloc, ne_realloc, ne_strdup and ne_strdnup provide wrappers for the equivalent functions in the standard C library. The wrappers provide the extra guarantee that if the C library equivalent returns NULL when no memory is available, an optional callback will be called, and the library will then call abort().

    ne_oom_callback registers a callback which will be invoked if an out of memory error is detected.

    Notes

    If the operating system uses optimistic memory allocation, the C library memory allocation routines will not return NULL, so it is not possible to gracefully handle memory allocation failures.

    Prev   

    Bibliography

    [SSL-and-TLS] SSL and TLS: Designing and Building Secure Systems. Eric Rescorla. 0-201-62598-3. Addison-Wesley. March 2001.

    [REC-XML-names] World Wide Web Consortium. Namespaces in XML. January 1999.

    [RFC2616] Hypertext Transfer Protocol—HTTP/1.1. Roy Fielding, Jim Gettys, Jeff Mogul, Henrik Frystyk, Larry Masinter, Paul Leach, and Tim Berners-Lee. IETF. --libs

    Print the flags which should be passed to the linker when linking an application which uses the neon library

    --la-file

    Print the location of the libtool library script, libneon.la, which can be used to link against neon by applications using libtool.

    --version

    Print the version of the library

    --prefix dir

    If dir is given; relocate output of --cflags and --libs as if neon was installed in given prefix directory. Otherwise, print the installation prefix of the library.

    --support feature

    The script exits with success if feature is supported by the library.

    --help

    Print help message; includes list of known features and whether they are supported or not.

    Example

    Below is a Makefile fragment which could be used to build an application against an installed neon library, when the neon-config script can be found in $PATH.

    CFLAGS = `neon-config --cflags`
    LIBS = `neon-config --libs`
    OBJECTS = myapp.o
    TARGET = myapp
    
    $(TARGET): $(OBJECTS)
    	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
    
    myapp.o: myapp.c
    	$(CC) $(CFLAGS) -c myapp.c -o myapp.o
    .fi .ft .HP \w'char\ *ne_strhash('u .BI "char *ne_strhash(unsigned\ int\ " "flags" ", " "\&.\&.\&." ");" .HP \w'char\ *ne_vstrhash('u .BI "char *ne_vstrhash(unsigned\ int\ " "flags" ", va_list\ " "ap" ");" .SH "DESCRIPTION" .PP The \fBne_strhash\fR and \fBne_vstrhash\fR functions can be used to create hashes\&. The varargs argument list must be \fBconst char *\fR strings followed by a NULL terminator\&. The \fIflags\fR argument must select exactly one hash algorithm from the list below, which can be optionally bitwise\-ORed with one of the formatting option\&. The hash is calculated for the concatenation of the argument list, without separators\&. .SS "Hash algorithms" .PP The following hash algorithms are available: .PP \fBNE_HASH_MD5\fR .RS 4 MD5 .RE .PP \fBNE_HASH_SHA256\fR .RS 4 SHA\-256 (SHA\-2) .RE .PP \fBNE_HASH_SHA512\fR .RS 4 SHA\-512 (SHA\-2) .RE .PP \fBNE_HASH_SHA256_256\fR .RS 4 SHA\-512/256 (SHA\-2) .RE .SS "Formatting options" .PP By default, the hash is returned as a hexadecimal lower\-case character string\&. The following formatting options are available: .PP \fBNE_HASH_COLON\fR .RS 4 colon\-separated hex pairs, e\&.g\&. "aa:11:22\&.\&.\&." .RE .PP \fBNE_HASH_SPACE\fR .RS 4 space\-separated hex pairs, e\&.g\&. "aa 11 22\&.\&.\&." .RE .SH "RETURN VALUE" .PP The return value is the ASCII hexadecimal representation of the hash as a malloc\-allocated, NUL\-terminated string, or NULL if the hash cannot be created\&. The string length is determined by the hash algorithm (and formatting options used)\&. Support for hash algorithms is specific to the SSL toolkit with which neon is compiled\&. Some systems will further restrict hash availability at runtime, e\&.g\&. due to FIPS mode\&. .SH "HISTORY" .PP \fBne_strhash\fR and \fBne_vstrhash\fR is available in neon 0\&.32\&.0 and later\&. .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br '\" t .\" Title: ne_get_request_target .\" info">#include <ne_i18n.h>
    void ne_i18n_init(const char *encoding);
     

    Description

    The ne_i18n_init function can be used to enable support for translated messages in the neon library. The encoding parameter, if non-NULL, specifies the character encoding required for generated translated string. If it is NULL, the appropriate character encoding for the process locale will be used.

    This call is only strictly necessary if either:

    1. neon has been installed into a different prefix than the gettext implementation on which it depends for i18n purposes, or
    2. the caller requires that translated messages are in a particular character encoding.

    If ne_i18n_init is never called, the message catalogs will not be found if case (a) applies (and so English error messages will be used), and will use the default character encoding specified by the process locale. The library will otherwise operate correctly.

    Note that the encoding used is a process-global setting and so results may be unexpected if other users of neon within the process call ne_i18n_init with a different encoding parameter.

    This chapter provides an introduction to neon, giving an overview of the range of features offered, and some general guidelines for using the neon API.

    neon aims to provide a modern, flexible, and simple API in the C programming language for implementing HTTP and WebDAV support. The WebDAV functionality is entirely separate from the bas proxy configuration" .PP The \fBne_session_socks_proxy\fR function configures the session to use a SOCKS proxy\&. The \fIversion\fR indicates which version of the SOCKS protocol should be used\&. The \fIhostname\fR and \fIport\fR parameters specify the SOCKS proxy location\&. Note that a server with only an IPv6 address cannot be used with SOCKS v4 or v4A\&. The interpretation of the other arguments depends on the version specified: .PP \fBNE_SOCK_SOCKSV4\fR (version 4) .RS 4 The \fIusername\fR parameter must be non\-NULL; the \fIpassword\fR parameter is ignored\&. .RE .PP \fBNE_SOCK_SOCKSV4A\fR (version 4A) .RS 4 The \fIusername\fR parameter must be non\-NULL; the \fIpassword\fR parameter is ignored\&. .RE .PP \fBNE_SOCK_SOCKSV5\fR (version 5) .RS 4 The \fIusername\fR parameter may be NULL; if it is non\-NULL, the \fIpassword\fR parameter must also be non\-NULL; otherwise, it is ignored\&.\&. .RE .SS "Origin server address override" .PP The \fBne_set_addrlist\fR function forces use of an address and port the a specified list when establishing a TCP connection, ignoring the "real" hostname and port identifying the origin server for the session (as passed to \fBne_session_create\fR)\&. The origin server\*(Aqs "real" hostname and port will still be used in the Host header in HTTP requests\&. When a connection is required, the library will iterate through the \fIaddrlist\fR list, attempting to connect to the address \fIaddrlist[0]\fR through to \fIaddrlist[count\-1]\fR in turn, until a connection can be established\&. .SH "RETURN VALUES" .PP None of the functions described here has a return value\&. .SH "EXAMPLES" .PP Create and destroy a session: .sp .if n \{\ .RS 4 .\} .nf ne_session *sess; sess = ne_session_create("http", "host\&.example\&.com", 80); ne_session_proxy(sess, "proxy\&.example\&.com", 3128); /* \&.\&.\&. use sess \&.\&.\&. */ ne_session_destroy(sess); .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP ne_ssl_set_verify, ne_ssl_trust_cert, ne_sock_init, ne_set_de .fi .ft .HP \w'typedef\ int\ ne_ssl_verify_fn('u .BI "typedef int ne_ssl_verify_fn(void\ *" "userdata" ", int\ " "failures" ", const\ ne_ssl_certificate\ *" "cert" ");" .HP \w'void\ ne_ssl_set_verify('u .BI "void ne_ssl_set_verify(ne_session\ *" "session" ", ne_ssl_verify_fn\ " "verify_fn" ", void\ *" "userdata" ");" .SH "DESCRIPTION" .PP To enable manual SSL certificate verification, a callback can be registered using \fBne_ssl_set_verify\fR\&. If such a callback is not registered, when a connection is established to an SSL server which does not present a certificate signed by a trusted CA (see ne_ssl_trust_cert), or if the certificate presented is invalid in some way, the connection will fail\&. .PP When the callback is invoked, the \fIfailures\fR parameter gives a bitmask indicating in what way the automatic certificate verification failed\&. The value is equal to the bit\-wise OR of one or more of the following constants (and is guaranteed to be non\-zero): .PP \fBNE_SSL_NOTYETVALID\fR .RS 4 The certificate is not yet valid\&. .RE .PP \fBNE_SSL_EXPIRED\fR .RS 4 The certificate has expired\&. .RE .PP \fBNE_SSL_IDMISMATCH\fR .RS 4 The hostname used for the session does not match the hostname to which the certificate was issued\&. .RE .PP \fBNE_SSL_UNTRUSTED\fR .RS 4 The Certificate Authority which signed the certificate is not trusted\&. .RE .PP Note that if either of the \fBNE_SSL_IDMISMATCH\fR or \fBNE_SSL_UNTRUSTED\fR failures is given, the connection may have been intercepted by a third party, and must not be presumed to be \(lqsecure\(rq\&. .PP The \fIcert\fR parameter passed to the callback represents the certificate which was presented by the server\&. If the server presented a chain of certificates, the chain can be accessed using ne_ssl_cert_signedby\&. The \fIcert\fR object given is not valid after the callback returns\&. .SH "RETURN VALUE" .PP The verification callback must return zero to indicate that the certificate should be trulicert_import function reads a client certificate from a memory buffer using the PKCS#12 format. The ne_ssl_clicert_fromuri function loads a client certificate from a URI. URI schemes supported are defined by the SSL/TLS toolkit, and may include PKCS#11 URIs.

    A ne_ssl_client_cert object represents both a client certificate and the associated private key; the term "client certificate" is used here to refer to this pair. A client certificate object loaded by any of the above functions can be in one of two states: encrypted or decrypted. The ne_ssl_clicert_encrypted function will return non-zero if the client certificate is in the encrypted state.

    A client certificate must be in the decrypted state before it is associated with a session. ne_ssl_clicert_decrypt can be used to decrypt a client certificate using the appropriate password. This function must only be called if the object is in the encrypted state; if decryption fails, the certificate state does not change, so decryption can be attempted more than once using different passwords.

    A client certificate can be given a "friendly name" when it is created; ne_ssl_clicert_name will return this name (or NULL if no friendly name was specified). ne_ssl_clicert_name can be used when the client certificate is in either the encrypted or decrypted state, and will return the same string for the lifetime o to access response headers .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'const\ char\ *ne_get_response_header('u .BI "const char *ne_get_response_header(ne_request\ *" "request" ", const\ char\ *" "name" ");" .HP \w'void\ *ne_response_header_iterate('u .BI "void *ne_response_header_iterate(ne_request\ *" "request" ", void\ *" "cursor" ", const\ char\ **" "name" ", const\ char\ **" "value" ");" .SH "DESCRIPTION" .PP To retrieve the value of a response header field, the \fBne_get_response_header\fR function can be used, and is given the name of the header to return\&. .PP To iterate over all the response headers returned, the \fBne_response_header_iterate\fR function can be used\&. This function takes a \fIcursor\fR parameter which should be NULL to retrieve the first header\&. The function stores the name and value of the next header header in the \fIname\fR and \fIvalue\fR parameters, and returns a new cursor pointer which can be passed to \fBne_response_header_iterate\fR to retrieve the next header\&. .SH "RETURN VALUE" .PP \fBne_get_response_header\fR returns a string, or NULL if no header with that name was given\&. If used during request processing, the return value pointer is valid only until the next call to \fBne_begin_request\fR, or else, until the request object is destroyed\&. .PP Likewise, the cursor, names, and values returned by \fBne_response_header_iterate\fR are only valid until the next call to \fBne_begin_request\fR or until the request object is destroyed\&. .SH "EXAMPLES" .PP The following code will output the value of the Last\-Modified header for a resource: .sp .if n \{\ .RS 4 .\} .nf ne_request *req = ne_request_create(sess, "GET", "/foo\&.txt"); if (ne_request_dispatch(req) == NE_OK) { const char *mtime = ne_get_response_header(req, "Last\-Modified"); if (mtime) { printf("/foo\&.txt has last\-modified value %s\en", mtime); } } ne_request_destroy(req); .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP ne_stinguished name of the subject and of the issuer of a certificate, respectively.

    If a certificate object is part of a certificate chain, then ne_ssl_cert_signedby can be used to find the certificate which signed a particular certificate. For a self-signed certificate or a certificate for which the full chain is not available, this function will return NULL.

    Return value

    ne_ssl_cert_issuer and ne_ssl_cert_subject are guaranteed to never return NULL. ne_ssl_cert_identity may return NULL if the certificate has no specific “identity”. ne_ssl_cert_signedby may return NULL as covered above.

    Examples

    The following function could be used to display information about a given certificate:

    void dump_cert(const ne_ssl_certificate *cert) {
      const char *id = ne_ssl_cert_identity(cert);
      char *dn;
    
      if (id) 
        printf("Certificate was issued for '%s'.\n", id);
    
      dn = ne_ssl_readable_dname(ne_ssl_cert_subject(cert));
      printf("Subject: %s\n", dn);
      free(dn);
    
      dn = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert));
      printf("Issuer: %s\n", dn);
      free(dn);
    }

    Description

    The ne_ssl_readable_dname function creates a single-line, human-readable string out of an ne_ssl_dname object. The returned string is malloc()-allocated, and must be free()d by the caller.

    The ne_ssl_dname_cmp function compares two distinguished names, and returns zero if they are equal, or non-zero otherwise.

    Return value

    ne_ssl_readable_dname returns a malloc-allocated string, and never NULL.

    Examples

    See ne_ssl_cert_subject for an example use of ne_ssl_readable_dname.

    .so man3/ne_ssl_cert_read.3 Language-Team: Georgian <(nothing)> Language: ka MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Poedit 3.2.2 %s ალგორითმი დაიჯესტის გამოწვევაში მხარდაჭერილი არაა%s: %s (კოდი %d)%s: შეერთების მოლოდინის ვადა ამოიწურა%s: შეერთება დახურულია პროქსი სერვერის მიერ%s შეერთება დახურულია სერვერის მიერ%s: უცნობი შეცდომა (%u)%s: უცნობი ავარია (%u)ავთენტიფიკაცია ვერ მოხერდასერტიფიკატის გადამოწმების შეცდომა: %sნაგლát .HP \w'int\ ne_version_match('u .BI "int ne_version_match(int\ " "major" ", int\ " "minor" ");" .HP \w'const\ char\ *ne_version_string('u .BI "const char *ne_version_string(void);" .SH "DESCRIPTION" .PP The \fBne_version_match\fR function returns non\-zero if the library version is not of major version \fImajor\fR, or the minor version is less than \fIminor\fR\&. For neon versions 0\&.x, every minor version is assumed to be incompatible with every other minor version\&. .PP The \fBne_version_string\fR function returns a string giving the library version\&. .SH "EXAMPLES" .PP To require neon 1\&.x, version 1\&.2 or later: .sp .if n \{\ .RS 4 .\} .nf if (ne_version_match(1, 2)) { printf("Library version out of date: 1\&.2 required, found %s\&.", ne_version_string()); exit(1); } .fi .if n \{\ .RE .\} .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br .so man3/ne_iaddr_make.3 Standards compliance

    Description

    The ne_set_request_flag function enables or disables a per-request flag. Passing a non-zero value argument enables the flag, and zero disables it.

    The following flags are defined:

    NE_REQFLAG_EXPECT100

    enable this flag to use the "Expect: 100-continue" feature of HTTP/1.1, which allows the server to process request headers without reading the entire request body. This saves time and bandwidth if the server gives an authentication challenge (requiring the request to be resent), but has interoperability problems with some older servers.

    NE_REQFLAG_IDEMPOTENT

    disable this flag if the request uses a non-idempotent method such as POST

    NE_REQFLAG_1XXTIMEOUT (default on)

    disable this flag to disable overall timeout when reading interim (1xx) responses;

    Return value

    The ne_get_request_flag function returns zero if a flag is disabled, less than zero if the flag is not supported, or greater than zero if the flag is enabled.

    See also

    ne_request_create.

    Next

    Name

    ne_ssl_set_protovers — set session SSL/TLS minimum or maximum protocol version

    Synopsis

    #include <ne_session.h>
    int ne_ssl_set_protovers(ne_session *sess,
     enum ne_ssl_protocol min,
     enum ne_ssl_protocol max);
     

    Description

    The ne_ssl_set_protovers function sets the minimum and/or maximum SSL/TLS version. Either minimum and/or maximum may be specified as NE_SSL_PROTO_UNSPEC, in which case no limit is imposed.

    Return value

    The ne_ssl_set_protovers function returns zero on success or non-zero on error. Errors include an invalid range (minimum above maximum), or if the protocol version is not supported by the SSL/TLS toolkit in use, or if SSL/TLS is not in use for the session.

    History

    ne_ssl_set_protovers is available in neon 0.34.0 and later.

    See also

    ne_ssl_proto_name, ne_session_createHow to use neon from your application

    .so man3/ne_get_response_header.3 '\" t .\" Title: ne_xml_create .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 15 July 2025 .\" Manual: neon API reference .\" Source: neon 0.35.0 .\" Language: English .\" .TH "NE_XML_CREATE" "3" "15 July 2025" "neon 0.35.0" "neon API reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ne_xml_create, ne_xml_destroy \- create and destroy an XML parser .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'ne_xml_parser\ *ne_xml_create('u .BI "ne_xml_parser *ne_xml_create(void);" .HP \w'void\ ne_xml_destroy('u .BI "void ne_xml_destroy(ne_xml_parser\ *" "parser" ");" .SH "DESCRIPTION" .PP The \fBne_xml_create\fR function creates an XML parser object, which can be used for parsing XML documents using stacked SAX handlers\&. .SH "RETURN VALUE" .PP \fBne_xml_create\fR returns a pointer to an XML parser object, and never NULL .SH "SEE ALSO" .PP XXX .SH "COPYRIGHT" .br Copyright \(co 2001-2025 Joe Orton .br '\" t .\" Title: ne_buffer .ass="literal">off64_t according to whether LFS support is detected at build time. neon does not use or require the -D_FILE_OFFSET_BITS=64 macro definition.

    neon-config