|
How can I determine whether the data that was just received, is a HTTP-header?
I am writing HTTP proxy server application,it works ok with HTTP/1.0 and fails with HTTP/1.1...
For example, when the page contains some data wich needs to be loaded from other server this data is not displayed.
I think that browser, when configured to use HTTP/1.1 sends it's requests one after another without breaking the connection.
My code looks like:
Thread1(started on every connect from client):
recv(...);
// parse header get URL_to_connect
_beginthread(Thread2);
// wait here for Event..
while(!Thread1done && !Thread2Done)
{
recv(...); //from client
send(...); //to server
}
closesocket();
//Thread2
connect(server_ip);
// fire the Event...
while(!Thread1Done && !Thread2Done)
{
recv(); //from server
send(); //to client
}
closesocket();
I've read RFC, but found nothing concrete about this...
|
|
|
|
|
AFAIK you can't just recv() + send() to pass on any data to any server. You need to parse every request sent from the client to see f.ex. what server to pass on the request to.
|
|
|
|
|
Can anyone help me to detect the code pages of text strings?
I wish to know so that I could convert to and from!
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
If the only information you have is the strings themselves, you are out of luck. There is no way, short of reading the text, understanding what language it is and then start guessing what codepage for that language it uses.
|
|
|
|
|
How about if I have the text file?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
You still only have the characters (the "text"). You can't possibly know anything about what language and code-page was used to produce that file without some kind of meta content, wether in the text itself or as an alternate stream for the file or whatever).
|
|
|
|
|
The "Advanced Save As..." dialog in the VS.NET seems to indicate the correct codepage. What is the magic here?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
For a plain text file? I haven't got a clue. Named NTFS streams?
|
|
|
|
|
A code page is simply a mapping of a byte value to a glyph. Only a person can tell if text is being mapped using the right codepage - they have to look at the output and decide if it looks correct. To the computer it's all just bytes.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
So how does the VS.NET finds this out?
The Advanced Save As... popup indicates the correct code page of a text file, try it.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
|
I want to integrate MSCOMM.ocx into another ATL component. First I create
a composite control in the ATL component. Second I insert the MSCOMM.ocx into
the component. It creates two files mscomm.cpp and mscomm.h. Then I declare a
variable of CMSCOmm class. I don't know how to bind the variable and the control ID( Like the MFC: DDX_Control ). So I attach the hwnd of the control to the variable. But when I run, it will throw an assert on the line:
ASSERT( m_pCtrlSite != NULL );
Who can help me solve this problem?
|
|
|
|
|
Hi everybody!
I have a typical problem here. My application is a multithreaded one. In one of the cases, there are multiple threads which will be using a common buffer which is a member variable of a particular class. This buffer is also allocated memory by one of these threads and to be accessed by the other threads. I am getting a dbg_heap error as debug assertion. How do i go about solving this problem. Please help me out as this is very urgent. Thanx in advance.
regards,
sailesh
|
|
|
|
|
If all of your threads are launched within the same program (i.e. there are no DLLs or external libs involved) then your problem most likely has nothing to do with multithreading issues, but rather chances are you're somehow corrupting the buffer (by writing out of its bounds, for instance.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anybody know some easy library or source code for voice
generation and recognation. I don't want to use windows
SAPI.
|
|
|
|
|
There are none.
Both subjects are inherently non-"easy".
|
|
|
|
|
Jep. I know, subjects are quite difficult. That's is reason I would
find them somewhere. Microsoft SAPI wuold be nice, but i don't
want to use it.
|
|
|
|
|
Kristian33 wrote:
Microsoft SAPI wuold be nice, but i don't
want to use it.
Why? Is it some random decision?
|
|
|
|
|
I am trying to use ADO to call an Oracle stored procedure, and it just hangs. It's just a simple insert, and doing it as a normal insert crashes with 'invalid character', but writing the same query to disk and passing it to Oracle by hand works fine.
Any Oracle gurus out there with any suggestions ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Christian Graus wrote:
doing it as a normal insert crashes with 'invalid character'
Do you have a trailing ';' in the query text this is the most common mistake which people do while passing ADO queries to Oracle.
|
|
|
|
|
Tried it with and without. Also copied it directly into a bootstrap and it works fine there.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Did you try dumping the Command.CommandText property or rs.Source to Debug log and running it using SQL*Plus. I am sure about one thing ';' ain't going to work. It may be happening that while constructing the query something may have comeup like quotes which oracle doesnot like. This is what I was hinting yesterday when I was telling you about unfriendly oracle error messages. "Invalid character" doesnot mean anything atleast if position is indiacted I am willing to give them a 'C'. Anyway good luck!
|
|
|
|
|
Rama Krishna wrote:
Did you try dumping the Command.CommandText property or rs.Source to Debug log and running it using SQL*Plus.
Yes, I did that and it all worked fine in SQL+, that was a big part of my confusion.
Rama Krishna wrote:
It may be happening that while constructing the query something may have comeup like quotes which oracle doesnot like.
I streamed the query to a file, and when put direct into SQL+ or a bootstrap we wrote, it works fine.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
If you have not already solved it. I did find one thing strange. If you run the exe from a network share or for that matter any compnent comes from a Network Share, I have seen this error occur. It took me 3 days to track this problem.
|
|
|
|
|
Can you post the ADO code. I've had a lot of bother with Oracle and ADO so I might be able to spot something.
What version of Oracle client and MDAC do you have installed?
Michael
"Eureka" is Greek for "This bath is too hot"
|
|
|
|
|
Thanks - I am at work again and so able to post it...
_variant_t vRecordsAffected;
_variant_t vtParams = vtMissing;
m_pConnection->BeginTrans();
bTransactionStarted = true;
_CommandPtr pcmdInsertBinaryData (__uuidof(Command));
pcmdInsertBinaryData->ActiveConnection = m_pConnection;
/*
ostringstream ss;
ss << "INSERT INTO "
<< "tblAttachmentVersions "
<< " (QFileid, RevisionCount, filename, mimetype) "
<< " VALUES "
<< " ( " << nQFileID << ", " << lDataID << ", '" << b_tFileName << "', '" << b_tMimeType << "' );";
pcmdInsertBinaryData->CommandText = ss.str().c_str();
pcmdInsertBinaryData->CommandType = adCmdText;
pcmdInsertBinaryData->Execute(&vRecordsAffected, &vtParams, adExecuteNoRecords);
//*///
pcmdInsertBinaryData->CommandText = "QFile_InsertAttachment";
pcmdInsertBinaryData->CommandType = adCmdStoredProc;
_ParameterPtr pprmInsert;
pprmInsert = pcmdInsertBinaryData->CreateParameter("QFileID", adInteger, adParamInput, 0, _variant_t(nQFileID, VT_I4));
pcmdInsertBinaryData->Parameters->Append(pprmInsert);
pprmInsert = pcmdInsertBinaryData->CreateParameter("DataID", adInteger, adParamInput, 0, _variant_t(lDataID, VT_I4));
pcmdInsertBinaryData->Parameters->Append(pprmInsert);
pprmInsert = pcmdInsertBinaryData->CreateParameter("FileName", adBSTR, adParamInput, 255, b_tFileName);
pcmdInsertBinaryData->Parameters->Append(pprmInsert);
pprmInsert = pcmdInsertBinaryData->CreateParameter("MimeType", adBSTR, adParamInput, 255, b_tMimeType);
pcmdInsertBinaryData->Parameters->Append(pprmInsert);
pcmdInsertBinaryData->Execute(&vRecordsAffected, &vtMissing, adExecuteNoRecords);
The commented out bit is how I tried it with a command, which gives the afore mentioned error. I've tried all sorts of permutations, with and without the ;, simplified down so the only thing I enter is the primary key, and it always gives an invalid character error. Every thing I have tried, if streamed to a file, works right away in SQL+. The stored procedure hangs indefinately, and it looks like this:
(QFileID IN tblAttachmentVersions.qfileid%TYPE,
DataID IN tblAttachmentVersions.RevisionCount%TYPE,
Filename IN tblAttachmentVersions.filename%TYPE,
MimeType IN tblAttachmentVersions.mimetype%TYPE)
IS
BEGIN
INSERT INTO tblAttachmentVersions
(QFileid, RevisionCount, binaryData, filename, mimetype)
VALUES
(QFileID , DataID , empty_blob(), Filename , MimeType);
END;
Thanks for the help.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|