Sponsored Content
Top Forums Programming unable to get end of file while reading HTTP data from socket Post 302243560 by calv on Monday 6th of October 2008 03:35:12 AM
Old 10-06-2008
The HTTP Protocol is designed to always send the size of the data in the "Content-Length:" field. You must count the bytes you read after the "\r\n\r\n", so you exactly stop, when there is nothing more to receive.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using loop reading a file,retrieving data from data base.

Hi All, I am having trouble through, I am reading the input from tab delimited file containing several records, e.g. line1 field1 field2 field3 so on.. line2 field1 field2 field3 so on.. .. .. on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)
Discussion started by: Sonu4lov
1 Replies

2. Programming

HTTP Keep-Alive socket problem

Hello everyone, I am a newbie in UNIX/Linux socket programming. This is a class project that I had trouble with. ================================================== I was trying to make “Keep-Alive” HTTP connections to the server in a tiny web crawler project. Here is the problem: when I tried... (0 Replies)
Discussion started by: imdupeng
0 Replies

3. UNIX for Advanced & Expert Users

problem with socket reading

I am not able to receive the message on socket in the current process when its waiting for its child to exit. code looks something like below //in one thread of the current process //thread 1 =============================================== int numBytes = read(sockid,buf,SIZE); //Now the... (2 Replies)
Discussion started by: swap007
2 Replies

4. Programming

C - HTTP Socket Programming

Hello everybody, I learning socket programming in C and was wondering if anybody here could help me out. I have two .c programs namely server.c and client.c ....... The client sends a message and the server in turn returns the value. Basically I want to send in a request to a webserver... (24 Replies)
Discussion started by: kev_1234
24 Replies

5. UNIX for Dummies Questions & Answers

Enter data at end of a file

Hi All, I have a sample datafile: 5.1 5.2 0.8 6.1 What I want to do is create an additional 3 rows with the number "0.7". so that I now have: 5.1 5.2 0.8 6.1 0.7 0.7 (3 Replies)
Discussion started by: tintin72
3 Replies

6. Shell Programming and Scripting

Perl: Reading data from other file

Hi, I am writting some perl scripts for daily backup process. In which I want to pass some data/referance from another txt file. Text file contains only one column and multiple rows. I want to pass this data to variables of another perl script. e.g. Refdoc.txt file contains data as: perl1... (3 Replies)
Discussion started by: n.dba
3 Replies

7. Red Hat

RAMDISK: EOF while reading compressed data ...Kernel panic - Unable to mount root

I was following this tutorial on How install the rpmfusion nvidia drivers in Fedora 13: F13, F12 & F11 Nvidia driver guides - FedoraForum.org Here's the tutorial: And this is what I did: First I executed the following commands: su rpm -Uvh ... (0 Replies)
Discussion started by: skyxn3t
0 Replies

8. Programming

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (0 Replies)
Discussion started by: senkerth
0 Replies

9. Shell Programming and Scripting

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (4 Replies)
Discussion started by: senkerth
4 Replies

10. Shell Programming and Scripting

append | to the end of each data in a file

I have a file which has data in the below format: 7810902|6783014102| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214 1089929|||||NewSpCreateAction request successful. Activity ID = <826528>||||100|n|2006-04-13 16:50:27|2006-04-13... (3 Replies)
Discussion started by: ankianand88
3 Replies
curl_easy_init(3)						  libcurl Manual						 curl_easy_init(3)

NAME
curl_easy_getinfo - Extract information from a curl session (added in 7.4) SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... ); DESCRIPTION
Request internal information from the curl session with this function. The third argument MUST be a pointer to a long, a pointer to a char * or a pointer to a double (as this documentation describes further down). The data pointed-to will be filled in accordingly and can be relied upon only if the function returns CURLE_OK. This function is intended to get used *AFTER* a performed transfer, all results from this function are undefined until the transfer is completed. AVAILABLE INFORMATION
These are informations that can be extracted: CURLINFO_EFFECTIVE_URL Pass a pointer to a 'char *' to receive the last used effective URL. CURLINFO_HTTP_CODE Pass a pointer to a long to receive the last received HTTP code. CURLINFO_FILETIME Pass a pointer to a long to receive the remote time of the retrieved document. If you get -1, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the CURLOPT_FILE- TIME option to curl_easy_setopt(3). (Added in 7.5) CURLINFO_TOTAL_TIME Pass a pointer to a double to receive the total transaction time in seconds for the previous transfer. This time does not include the connect time, so if you want the complete operation time, you should add the CURLINFO_CONNECT_TIME. CURLINFO_NAMELOOKUP_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the name resolving was completed. CURLINFO_CONNECT_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed. CURLINFO_PRETRANSFER_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. CURLINFO_STARTTRANSFER_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the first byte is just about to be trans- fered. This includes CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate the result. CURLINFO_REDIRECT_TIME Pass a pointer to a double to receive the total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. CURLINFO_REDIRECT_TIME contains the complete execution time for mul- tiple redirections. (Added in 7.9.7) CURLINFO_REDIRECT_COUNT Pass a pointer to a long to receive the total number of redirections that were actually followed. (Added in 7.9.7) CURLINFO_SIZE_UPLOAD Pass a pointer to a double to receive the total amount of bytes that were uploaded. CURLINFO_SIZE_DOWNLOAD Pass a pointer to a double to receive the total amount of bytes that were downloaded. CURLINFO_SPEED_DOWNLOAD Pass a pointer to a double to receive the average download speed that curl measured for the complete download. CURLINFO_SPEED_UPLOAD Pass a pointer to a double to receive the average upload speed that curl measured for the complete upload. CURLINFO_HEADER_SIZE Pass a pointer to a long to receive the total size of all the headers received. CURLINFO_REQUEST_SIZE Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true. CURLINFO_SSL_VERIFYRESULT Pass a pointer to a long to receive the result of the certification verification that was requested (using the CURLOPT_SSL_VERI- FYPEER option to curl_easy_setopt). (Added in 7.4.2) CURLINFO_CONTENT_LENGTH_DOWNLOAD Pass a pointer to a double to receive the content-length of the download. This is the value read from the Content-Length: field. (Added in 7.6.1) CURLINFO_CONTENT_LENGTH_UPLOAD Pass a pointer to a double to receive the specified size of the upload. (Added in 7.6.1) CURLINFO_CONTENT_TYPE Pass a pointer to a 'char *' to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this. (Added in 7.9.4) RETURN VALUE
If the operation was successful, CURLE_OK is returned. Otherwise an appropriate error code will be returned. SEE ALSO
curl_easy_setopt(3) BUGS
Surely there are some, you tell me! libcurl 7.9.7 25 Apr 2002 curl_easy_init(3)
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy