Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 574522 Details for
Bug 592929
RFE: better error message when HTTP transaction fails due to problems on server (HTTP errors 500, 502,503,504)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
an example reading the status line (tested on HTTP only)
status.c (text/plain), 1.20 KB, created by
Kamil Dudka
on 2012-04-02 14:23:23 UTC
(
hide
)
Description:
an example reading the status line (tested on HTTP only)
Filename:
MIME Type:
Creator:
Kamil Dudka
Created:
2012-04-02 14:23:23 UTC
Size:
1.20 KB
patch
obsolete
>#include <curl/curl.h> >#include <stdlib.h> > >static size_t dummy_write(void *ptr, size_t size, size_t nmemb, void *stream) >{ > (void) ptr; > (void) stream; > return size * nmemb; >} > >static size_t write_response(void *ptr, size_t size, size_t nmemb, void *stream) >{ > char *const str = ptr; > static int skip; > size_t i; > > (void) stream; > > size *= nmemb; > if (skip) > goto done; > > for (i = 0; i < size; ++i) { > char c = str[i]; > if ('\r' == c) > continue; > > putchar(c); > > if ('\n' == c) { > skip = 1; > goto done; > } > } > >done: > return size; >} > >int main(int argc, char *argv[]) >{ > CURL *curl; > > if (2 != argc) { > fprintf(stderr, "Usage: %s URL\n", argv[0]); > return EXIT_FAILURE; > } > > curl_global_init(CURL_GLOBAL_SSL); > > curl = curl_easy_init(); > curl_easy_setopt(curl, CURLOPT_URL, argv[1]); > curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, dummy_write); > curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response); > > if (CURLE_OK != curl_easy_perform(curl)) > return EXIT_FAILURE; > > curl_easy_cleanup(curl); > curl_global_cleanup(); > return EXIT_SUCCESS; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 592929
:
414529
|
414545
| 574522