10-05-2008
unable to get end of file while reading HTTP data from socket
I am trying to read HTTP data from a socket. However, for the final set of data being read using read(), read blocks and the control doesnt come back for further processing. I tried using select, but it didn't work...
Any help would be greatly acknowledged.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
http::proxy::bodyfilter::htmlparser
HTTP::Proxy::BodyFilter::htmlparser(3pm) User Contributed Perl Documentation HTTP::Proxy::BodyFilter::htmlparser(3pm)
NAME
HTTP::Proxy::BodyFilter::htmlparser - Filter using HTML::Parser
SYNOPSIS
use HTTP::Proxy::BodyFilter::htmlparser;
# $parser is a HTML::Parser object
$proxy->push_filter(
mime => 'text/html',
response => HTTP::Proxy::BodyFilter::htmlparser->new( $parser );
);
DESCRIPTION
The HTTP::Proxy::BodyFilter::htmlparser lets you create a filter based on the HTML::Parser object of your choice.
This filter takes a HTML::Parser object as an argument to its constructor. The filter is either read-only or read-write. A read-only
filter will not allow you to change the data on the fly. If you request a read-write filter, you'll have to rewrite the response-body
completely.
With a read-write filter, you must recreate the whole body data. This is mainly due to the fact that the HTML::Parser has its own buffering
system, and that there is no easy way to correlate the data that triggered the HTML::Parser event and its original position in the chunk
sent by the origin server. See below for details.
Note that a simple filter that modify the HTML text (not the tags) can be created more easily with HTTP::Proxy::BodyFilter::htmltext.
Creating a HTML::Parser that rewrites pages
A read-write filter is declared by passing "rw => 1" to the constructor:
HTTP::Proxy::BodyFilter::htmlparser->new( $parser, rw => 1 );
To be able to modify the body of a message, a filter created with HTTP::Proxy::BodyFilter::htmlparser must rewrite it completely. The
HTML::Parser object can update a special attribute named "output". To do so, the HTML::Parser handler will have to request the "self"
attribute (that is to say, require access to the parser itself) and update its "output" key.
The following attributes are added to the HTML::Parser object by this filter:
output
A string that will hold the data sent back by the proxy.
This string will be used as a replacement for the body data only if the filter is read-write, that is to say, if it was initialised
with "rw => 1".
Data should always be appended to "$parser->{output}".
message
A reference to the HTTP::Message that triggered the filter.
protocol
A reference to the HTTP::Protocol object.
METHODS
This filter defines three methods, called automatically:
filter()
The "filter()" method handles all the interactions with the HTML::Parser object.
init()
Initialise the filter with the HTML::Parser object passed to the constructor.
will_modify()
This method returns a boolean value that indicates to the system if it will modify the data passing through. The value is actually the
value of the "rw" parameter passed to the constructor.
SEE ALSO
HTTP::Proxy, HTTP::Proxy::Bodyfilter, HTTP::Proxy::BodyFilter::htmltext.
AUTHOR
Philippe "BooK" Bruhat, <book@cpan.org>.
COPYRIGHT
Copyright 2003-2006, Philippe Bruhat.
LICENSE
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
perl v5.12.4 2011-07-03 HTTP::Proxy::BodyFilter::htmlparser(3pm)