Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Search this Thread
Old 09-20-2004, 09:13 PM   #1
Registered: Oct 2003
Location: TX
Distribution: RH 8.0
Posts: 97

Rep: Reputation: 15
network programming -- bad request

I'm trying to make a web crawler. But when I do a loop to fill the buffer, it fills then keeps doing recv() calls and those calls get BAD REQUESTS with only part of the downloaded file.

char tBuffer[kBufferSize];
int bytesRead = 1;
//bytesRead = recv(s,tempBuffer,bufferSize,0);
while (bytesRead>0){

cout << "##################################" << endl << "Done Reading From Site" << endl;

acReadBuffer=acReadBuffer + tBuffer;
cout << acReadBuffer << endl;
Old 09-20-2004, 10:01 PM   #2
Registered: Oct 2003
Distribution: FreeBSD
Posts: 325

Rep: Reputation: 30
Post the request your sending to the server.
Old 09-21-2004, 02:28 PM   #3
Registered: Oct 2003
Location: TX
Distribution: RH 8.0
Posts: 97

Original Poster
Rep: Reputation: 15

command = "GET / HTTP/1.1 \r\nHost: "+host_name+"\r\n\r\nConnection: Close\r\n";
cout << command;
err = send(s,command.c_str(),strlen(command.c_str()),0);


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
opera: client-error-bad-request landroni Linux - Software 0 11-22-2005 11:22 AM
svc bad request dropping packet naveenrajn Linux - Networking 0 07-04-2005 05:22 AM
client-error-bad-request when trying to print with lp blas Linux - General 4 02-09-2005 11:30 AM
Bad Request when web page loading wmartino Linux - Networking 2 09-14-2003 10:25 AM
Dispatch_input: bad request line Advocate Linux - Security 3 05-04-2001 03:31 AM

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration